11
$\begingroup$

How to assign a different color / material to each inflow object in one simulation (bake)?

In the following example we tried to mix two inflows and experience the mixing between the two fluids. However, as bake starts there is only one domain object as fluid (object!) which does not respect color / material assigned to inflow objects!

enter image description here

$\endgroup$

3 Answers 3

3
$\begingroup$

Unfortunately, I don't know of any way to do this with the main fluid simulator, however it is possible with blender's SPH fluid simulator.

Note that there is currently no way to convert fluid particles into a mesh from blender. There are some python scripts that do this, but these are mostly pretty slow. There are also a few patches, but it seems development on these has been dropped for the most part.

Some advantages of the SPH fluid simulator:

  • No domain bounds

  • Supports inter-fluid interactions

  • Supports force fields

To mix to different colored fluids:

  1. Create two emitter planes (ShiftA> Mesh > Plane):

    enter image description here

  2. Add two separate particle systems to the planes in Properties > Particles:

    enter image description here

  3. Increase the Life time of the particles in Particles > Emission to be at least equal to the scene end frame:

    enter image description here

  4. Set the particle physics to Fluid in Particles > Physics:

    enter image description here

  5. Add an object to represent the fluid particles. It should be very low-poly, a 1 division icosphere works well (ShiftA> Mesh > Icosphere). Note that you will need one for each color:

    enter image description here

  6. Set the Shading to Smooth on the icospheres and move them to another layer (M)

  7. Set the particle type to Object in Particles > Render and select an icosphere in Dupli Object:

    enter image description here

  8. In Particles > Physics > Fluid interaction press the + button to add an particle system interaction and select the other emitter plane as the particle system object:

    enter image description here

  9. With both planes setup this way, add another object (e.g. a floor plane) and make it a collision object in Properties > Physics:

    enter image description here

  10. Create separate materials for each of the icospheres.

  11. Set the Size (in Particles > Physics) and Number (in Particles > Emission) for each particle system. Larger particles = lower resolution, smaller = higher resolution. Adjust these settings so as to make the particles appear as a fluid without making the simulation too heavy.

    enter image description here

  12. You may also want to set the cache step to 1 in Particles > Cache for each particle system to ensure accurate caching.

    enter image description here

Result:

enter image description here

See the wiki for more information about each setting.

$\endgroup$
4
  • $\begingroup$ We accepted this even though SPH simulation is not even close to the blender built-in fluid simulation result (our target). Regardless of the size of particles (even very small) it is too far from what we expected. We searched extensively and watched videos (youtube) but haven't found any promising solution considered this as a limit of technology or a work under progress. $\endgroup$
    – Developer
    Commented Dec 21, 2013 at 3:48
  • $\begingroup$ Ideally there would be a way to mesh the particles together into one solid mesh (you can kind of do this with meta balls, but it is very slow and still doesn't look the greatest). There are some patches and python addons to do this, but unfortunately it doesn't seem like this will be officially in blender for a while.. $\endgroup$
    – gandalf3
    Commented Apr 11, 2014 at 19:05
  • $\begingroup$ The first link is 404 $\endgroup$ Commented Aug 31, 2016 at 14:18
  • $\begingroup$ Wiki link is a 404. $\endgroup$ Commented Jan 4, 2018 at 19:24
3
$\begingroup$

Basically a scene similar to the one gandalf created.

But 4000 particles of size 0.1

enter image description here

set to Halo

enter image description here

and Fluid properties: Stiffness 0

Leave the impression that the fluids mix:

enter image description here

$\endgroup$
1
$\begingroup$

You can just use 2 complete fluid systems. You cannot bake with multiple domains, but you CAN play back more than one. Create the first sim and bake it to a directory. Now disable the Domain and create your second sim and bake to a new directory. Now enable the first domain and ensure it points to the correct bake directory. Both sims will play back and you can put whatever material you want on each. I have had as many as 5 sims running at once and each started at a different time. All in one scene.

$\endgroup$
1
  • 1
    $\begingroup$ But AFAIK they can't mix, like the OP seems to want. $\endgroup$
    – gandalf3
    Commented Oct 28, 2014 at 6:01

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .