FLIP Fluids Addon: A liquid fluid simulation tool for Blender

Thanks, nice answer ! I will try your recommended tip soon.

Is it too early for the Linux crowd to start using this addon? I gather from the Blendermarket site that Linux implementation is still ā€œexperimentalā€, but Iā€™d need a somewhat dependable version for production use. Iā€™ll prefer to wait for a stable implementation for eveyday use (ie. not testing) rather than using a version that isnā€™t properly beta/field tested. (But again, Iā€™d be happy to beta test an upcoming Linux version, however, thatā€™s another matter different to everyday production use.) I mostly need this for Archviz, btw. I havenā€™t had any luck with the new Mantaflow branch on Linux so far, and anyway, your addon seems more promising to me. The demo files on Github work just fine.

Hey Klutz,

Yes, at the moment Linux support is still experimental. So far we have had two reported cases of the simulator stopping calculations in the middle of a frame. The simulation can be resumed by restarting Blender, but ends up stopping unexpectedly at random times. This issue may be hardware dependent, I have not been able to reproduce this issue yet.

There is also an issue with the simulation engine not loading and producing an error on some Linux distributions. Iā€™m finding a better way to build the addon for Linux, so this should be cleared up in the near future. If your simulation starts in the demo, you will not experience this problem.

If the demo is working correctly for you, then it is likely you wonā€™t experience any issues. I would recommend running the Viscous Net and Fluid in an Invisible Box demo scenes at highest resolution to test. Make sure youā€™re testing with the most recent version of the demo which was updated last on May 11th.

The second issue may be caused by what I described earllier. Iā€™ll reconstruct the error condition and post the error msg, so you can check if itā€™s the same error. (If so, itā€™s easily resolved.)

Edit: This the error message. The last line is the most important, but possibly a bit misleading. Running ./blender --debug-python gives a little more info.

Traceback (most recent call last):
File "/home/[User name]/.config/blender/2.79/scripts/addons/flip_fluids_demo/materials/material_library.py", line 26, in get_surface_material_enums_ui
    __check_custom_icons_initialized()
  File "/home/[User name]/.config/blender/2.79/scripts/addons/flip_fluids_demo/materials/material_library.py", line 261, in __check_custom_icons_initialized
    __initialize_material_library_icons()
  File "/home/[User name]/.config/blender/2.79/scripts/addons/flip_fluids_demo/materials/material_library.py", line 230, in __initialize_material_library_icons
    __validate_enum_icons()
  File "/home/[User name]/.config/blender/2.79/scripts/addons/flip_fluids_demo/materials/material_library.py", line 195, in __validate_enum_icons
    with open(blend_path, "rb") as f:
FileNotFoundError: [Errno 2] No such file or directory: '/home/[User name]/.config/blender/2.79/scripts/addons/flip_fluids_demo/materials/material_library.blend'
File "/home/[User name]/.config/blender/2.79/scripts/addons/flip_fluids_demo/materials/material_library.py", line 25, in get_surface_material_enums_ui
Traceback (most recent call last):
  File "/home/[User name]/.config/blender/2.79/scripts/addons/flip_fluids_demo/materials/material_library.py", line 26, in get_surface_material_enums_ui
    __check_custom_icons_initialized()
  File "/home/[User name]/.config/blender/2.79/scripts/addons/flip_fluids_demo/materials/material_library.py", line 261, in __check_custom_icons_initialized
    __initialize_material_library_icons()
  File "/home/[User name]/.config/blender/2.79/scripts/addons/flip_fluids_demo/materials/material_library.py", line 230, in __initialize_material_library_icons
    __validate_enum_icons()
  File "/home/[User name]/.config/blender/2.79/scripts/addons/flip_fluids_demo/materials/material_library.py", line 195, in __validate_enum_icons
    with open(blend_path, "rb") as f:
FileNotFoundError: [Errno 2] No such file or directory: '/home/[User name]/.config/blender/2.79/scripts/addons/flip_fluids_demo/materials/material_library.blend'
File "/home/[User name]/.config/blender/2.79/scripts/addons/flip_fluids_demo/materials/material_library.py", line 25, in get_surface_material_enums_ui
RNA Warning: Current value "23197" matches no enum in 'DomainMaterialsProperties', '', 'surface_material'
Traceback (most recent call last):
  File "/home/[User name]/.config/blender/2.79/scripts/addons/flip_fluids_demo/materials/material_library.py", line 38, in get_whitewater_material_enums_ui
    __check_custom_icons_initialized()
  File "/home/[User name]/.config/blender/2.79/scripts/addons/flip_fluids_demo/materials/material_library.py", line 261, in __check_custom_icons_initialized
    __initialize_material_library_icons()
  File "/home/[User name]/.config/blender/2.79/scripts/addons/flip_fluids_demo/materials/material_library.py", line 230, in __initialize_material_library_icons
    __validate_enum_icons()
  File "/home/[User name]/.config/blender/2.79/scripts/addons/flip_fluids_demo/materials/material_library.py", line 195, in __validate_enum_icons
    with open(blend_path, "rb") as f:
FileNotFoundError: [Errno 2] No such file or directory: '/home/[User name]/.config/blender/2.79/scripts/addons/flip_fluids_demo/materials/material_library.blend'
File "/home/[User name]/.config/blender/2.79/scripts/addons/flip_fluids_demo/materials/material_library.py", line 37, in get_whitewater_material_enums_ui
Traceback (most recent call last):
  File "/home/[User name]/.config/blender/2.79/scripts/addons/flip_fluids_demo/materials/material_library.py", line 38, in get_whitewater_material_enums_ui
    __check_custom_icons_initialized()
  File "/home/[User name]/.config/blender/2.79/scripts/addons/flip_fluids_demo/materials/material_library.py", line 261, in __check_custom_icons_initialized
    __initialize_material_library_icons()
  File "/home/[User name]/.config/blender/2.79/scripts/addons/flip_fluids_demo/materials/material_library.py", line 230, in __initialize_material_library_icons
    __validate_enum_icons()
  File "/home/[User name]/.config/blender/2.79/scripts/addons/flip_fluids_demo/materials/material_library.py", line 195, in __validate_enum_icons
    with open(blend_path, "rb") as f:
FileNotFoundError: [Errno 2] No such file or directory: '/home/[User name]/.config/blender/2.79/scripts/addons/flip_fluids_demo/materials/material_library.blend'
File "/home/[User name]/.config/blender/2.79/scripts/addons/flip_fluids_demo/materials/material_library.py", line 37, in get_whitewater_material_enums_ui
RNA Warning: Current value "665356" matches no enum in 'DomainMaterialsProperties', '', 'whitewater_foam_material'
Traceback (most recent call last):
  File "/home/[User name]/.config/blender/2.79/scripts/addons/flip_fluids_demo/materials/material_library.py", line 38, in get_whitewater_material_enums_ui
    __check_custom_icons_initialized()
  File "/home/[User name]/.config/blender/2.79/scripts/addons/flip_fluids_demo/materials/material_library.py", line 261, in __check_custom_icons_initialized
    __initialize_material_library_icons()
  File "/home/[User name]/.config/blender/2.79/scripts/addons/flip_fluids_demo/materials/material_library.py", line 230, in __initialize_material_library_icons
    __validate_enum_icons()
  File "/home/[User name]/.config/blender/2.79/scripts/addons/flip_fluids_demo/materials/material_library.py", line 195, in __validate_enum_icons
    with open(blend_path, "rb") as f:
FileNotFoundError: [Errno 2] No such file or directory: '/home/[User name]/.config/blender/2.79/scripts/addons/flip_fluids_demo/materials/material_library.blend'
File "/home/[User name]/.config/blender/2.79/scripts/addons/flip_fluids_demo/materials/material_library.py", line 37, in get_whitewater_material_enums_ui
Traceback (most recent call last):
  File "/home/[User name]/.config/blender/2.79/scripts/addons/flip_fluids_demo/materials/material_library.py", line 38, in get_whitewater_material_enums_ui
    __check_custom_icons_initialized()
  File "/home/[User name]/.config/blender/2.79/scripts/addons/flip_fluids_demo/materials/material_library.py", line 261, in __check_custom_icons_initialized
    __initialize_material_library_icons()
  File "/home/[User name]/.config/blender/2.79/scripts/addons/flip_fluids_demo/materials/material_library.py", line 230, in __initialize_material_library_icons
    __validate_enum_icons()
  File "/home/[User name]/.config/blender/2.79/scripts/addons/flip_fluids_demo/materials/material_library.py", line 195, in __validate_enum_icons
    with open(blend_path, "rb") as f:
FileNotFoundError: [Errno 2] No such file or directory: '/home/[User name]/.config/blender/2.79/scripts/addons/flip_fluids_demo/materials/material_library.blend'
File "/home/[User name]/.config/blender/2.79/scripts/addons/flip_fluids_demo/materials/material_library.py", line 37, in get_whitewater_material_enums_ui
RNA Warning: Current value "665356" matches no enum in 'DomainMaterialsProperties', '', 'whitewater_bubble_material'
Traceback (most recent call last):
  File "/home/[User name]/.config/blender/2.79/scripts/addons/flip_fluids_demo/materials/material_library.py", line 38, in get_whitewater_material_enums_ui
    __check_custom_icons_initialized()
  File "/home/[User name]/.config/blender/2.79/scripts/addons/flip_fluids_demo/materials/material_library.py", line 261, in __check_custom_icons_initialized
    __initialize_material_library_icons()
  File "/home/[User name]/.config/blender/2.79/scripts/addons/flip_fluids_demo/materials/material_library.py", line 230, in __initialize_material_library_icons
    __validate_enum_icons()
  File "/home/[User name]/.config/blender/2.79/scripts/addons/flip_fluids_demo/materials/material_library.py", line 195, in __validate_enum_icons
    with open(blend_path, "rb") as f:
FileNotFoundError: [Errno 2] No such file or directory: '/home/[User name]/.config/blender/2.79/scripts/addons/flip_fluids_demo/materials/material_library.blend'
File "/home/[User name]/.config/blender/2.79/scripts/addons/flip_fluids_demo/materials/material_library.py", line 37, in get_whitewater_material_enums_ui
Traceback (most recent call last):
  File "/home/[User name]/.config/blender/2.79/scripts/addons/flip_fluids_demo/materials/material_library.py", line 38, in get_whitewater_material_enums_ui
    __check_custom_icons_initialized()
  File "/home/[User name]/.config/blender/2.79/scripts/addons/flip_fluids_demo/materials/material_library.py", line 261, in __check_custom_icons_initialized
    __initialize_material_library_icons()
  File "/home/[User name]/.config/blender/2.79/scripts/addons/flip_fluids_demo/materials/material_library.py", line 230, in __initialize_material_library_icons
    __validate_enum_icons()
  File "/home/[User name]/.config/blender/2.79/scripts/addons/flip_fluids_demo/materials/material_library.py", line 195, in __validate_enum_icons
    with open(blend_path, "rb") as f:
FileNotFoundError: [Errno 2] No such file or directory: '/home/[User name]/.config/blender/2.79/scripts/addons/flip_fluids_demo/materials/material_library.blend'
File "/home/[User name]/.config/blender/2.79/scripts/addons/flip_fluids_demo/materials/material_library.py", line 37, in get_whitewater_material_enums_ui
RNA Warning: Current value "665356" matches no enum in 'DomainMaterialsProperties', '', 'whitewater_spray_material'
Traceback (most recent call last):
  File "/home/[User name]/.config/blender/2.79/scripts/addons/flip_fluids_demo/__init__.py", line 95, in load_post
    materials.load_post()
  File "/home/[User name]/.config/blender/2.79/scripts/addons/flip_fluids_demo/materials/__init__.py", line 34, in load_post
    material_library.load_post()
  File "/home/[User name]/.config/blender/2.79/scripts/addons/flip_fluids_demo/materials/material_library.py", line 362, in load_post
    __initialize_material_library_icons()
  File "/home/[User name]/.config/blender/2.79/scripts/addons/flip_fluids_demo/materials/material_library.py", line 230, in __initialize_material_library_icons
    __validate_enum_icons()
  File "/home/[User name]/.config/blender/2.79/scripts/addons/flip_fluids_demo/materials/material_library.py", line 195, in __validate_enum_icons
    with open(blend_path, "rb") as f:
FileNotFoundError: [Errno 2] No such file or directory: '/home/[User name]/.config/blender/2.79/scripts/addons/flip_fluids_demo/materials/material_library.blend'
Traceback (most recent call last):
  File "/home/[User name]/.config/blender/2.79/scripts/addons/flip_fluids_demo/pyfluid/pyfluid.py", line 60, in _load_library
    library = ctypes.cdll.LoadLibrary(libfile)
  File "/media/Tera/Programfiler/Blender/blender-2.79b-linux-glibc219-x86_64/2.79/python/lib/python3.5/ctypes/__init__.py", line 425, in LoadLibrary
    return self._dlltype(name)
  File "/media/Tera/Programfiler/Blender/blender-2.79b-linux-glibc219-x86_64/2.79/python/lib/python3.5/ctypes/__init__.py", line 347, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.22' not found (required by /home/[User name]/.config/blender/2.79/scripts/addons/flip_fluids_demo/pyfluid/lib/libblpyfluid.so)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/[User name]/.config/blender/2.79/scripts/addons/flip_fluids_demo/bake.py", line 1149, in bake
    fluidsim = FluidSimulation(init_data.isize, init_data.jsize, init_data.ksize, init_data.dx)
  File "/home/[User name]/.config/blender/2.79/scripts/addons/flip_fluids_demo/pyfluid/fluidsimulation.py", line 65, in __init__
    self._init_from_dimensions(isize, jsize, ksize, dx)
  File "/home/[User name]/.config/blender/2.79/scripts/addons/flip_fluids_demo/pyfluid/method_decorators.py", line 68, in check_values
    return func(self, *args)
  File "/home/[User name]/.config/blender/2.79/scripts/addons/flip_fluids_demo/pyfluid/fluidsimulation.py", line 81, in _init_from_dimensions
    libfunc = lib.FluidSimulation_new_from_dimensions
  File "/home/[User name]/.config/blender/2.79/scripts/addons/flip_fluids_demo/pyfluid/pyfluid.py", line 39, in __getattr__
    self._lib = self._load_library("pyfluid")
  File "/home/[User name]/.config/blender/2.79/scripts/addons/flip_fluids_demo/pyfluid/pyfluid.py", line 64, in _load_library
    raise LibraryLoadError(msg)
flip_fluids_demo.pyfluid.pyfluid.LibraryLoadError: 'Unable to load fluid engine library: <libblpyfluid.so>. Try updating/reinstalling your system graphics drivers and try again.'
Exception ignored in: <bound method FluidSimulation.__del__ of <flip_fluids_demo.pyfluid.fluidsimulation.FluidSimulation object at 0x7f6383068d30>>
Traceback (most recent call last):
  File "/home/[User name]/.config/blender/2.79/scripts/addons/flip_fluids_demo/pyfluid/fluidsimulation.py", line 88, in __del__
    libfunc = lib.FluidSimulation_destroy
  File "/home/[User name]/.config/blender/2.79/scripts/addons/flip_fluids_demo/pyfluid/pyfluid.py", line 39, in __getattr__
    self._lib = self._load_library("pyfluid")
  File "/home/[User name]/.config/blender/2.79/scripts/addons/flip_fluids_demo/pyfluid/pyfluid.py", line 64, in _load_library
    raise LibraryLoadError(msg)
flip_fluids_demo.pyfluid.pyfluid.LibraryLoadError: 'Unable to load fluid engine library: <libblpyfluid.so>. Try updating/reinstalling your system graphics drivers and try again.'

Thank you for the reply, If possible I would really appreciate advice on how to approach this sim.

I have a large ship, The titanic, breaking and impacting the water.

This sketch is approximately how high I want the splash to go. In low res I have been able to get this But when I simulate at high detail. It splashes about twice the distance. It seems much greater energy is being put into the particles reaction. how can I reduce the energy.

To try and correct this I scaled all the objects in the scene. Currently the domain is about 500 units wide. But the simulation still has similar results.

I want to reduce the height of the splash to give the right feel, what is the best way to approach this?

A. Continue scaling the model and domain? Is there a limit to domain Size?

B. Increase the viscosity of the liquid to try and reduce the height the water splashes? would this work with white water enabled?

Is there a way to reduce the energy of the reaction ?

I sent the blend file via we transfer to flip.fluids.beta email. for you to have a look if you like.

I would really appreciate any suggestions on the size and value settings that would best suit.

Thank you for your help.

PS. Just wanted to add I really like to naturalistic results the simulation is getting great work! and I ve been running a sim 2 or 3 times a day for the last week and am only asking as a last resort.

I can confirm the first issue, ie. the simulation freezing. As you say, it can be restarted (remember to save your file!), so itā€™s not a show stopper. Does this happen on Linux only? If so, that may be a hint. Iā€™ll try to look into it.

Iā€™m not entirely sure where to find the My 11 version, though. The one on the Github page is from May 8, as far as I can see.

The high res (200) simulation seems to work, too, btw.

Hey Klutz,

Yes the GLIBC version mismatch is the second issue. What is your solution to this? I am quite new to Linux development and am still learning how this all works. I came across this Holy Build Box solution that seemed promising, but have not had a chance to try this out yet.

Thanks for letting me know that youā€™re experiencing this issue too! This has only been reported on Linux, but I have yet been able to reproduce this.

The most recent version of the demo is on the Demo Addon Page and may be downloaded through this link.

Hey DavidMcDermott,

I would approach this simulation first by setting appropriate scales and timing. I checked out the .blend file and with a domain scale of 540m, that would make the titanic object about 600m long. I just checked that the titanic is about 270m in length. The larger size of the ship could account for all of the extra splashing. The next thing to set would be the timing. At 30fps, you animation is 55 seconds long. Iā€™m not sure if this is accurate, but if the obstacle is moving too fast this could also account for the large splash.

I would not recommend adding viscosity. The viscosity solver works best for thicker fluids and would add a lot of time to the sim.

There is a way to reduce the energy of the reaction. You may try raising the PIC/FLIP ratio in the Advanced Settings panel. A higher PIC/FLIP ratio creates a less accurate simulation and tends to reduce energy.

Another way you could try to reduce the splash is to increase the force of gravity.

Hope this helps!

Thanks for the tips! I will give it a try.

I think I mentioned it in the first post, but Iā€™ll try to elaborate a bit more. If you look at the image below, youā€™ll see that the file icon marked in green points (ā€œlinksā€) to another file, hence the arrow. Now, on vanilla installations, such as Ubuntu 17.10, that file is libstdc++.so.6.0.21 (the third from the left). It should point to libstdc++.so.6.0.22, the fourth from the left.

But libstdc++.so.6.0.22 doesnā€™t come with older versions of Ubuntu, and probably not with older versions of other Linux distros, such as CentOs, Redhat aso. either.

So you have to install libstdc++.so.6.0.22 in your library folder (/usr/lib64) either manually or by using a package installer. For convenience, Iā€™m enclosing the link for Xenial, which is probably still the most commonly used Ubuntu version. (But if youā€™re not comfortable with installing libraries on your own, you probably should avoid doing this, because you can mess up badly if you do anything wrong. And for heavenā€™s sake, donā€™t delete any files from the library folders!)

Once you have libstdc++.so.6.0.22 installed like my screenshot shows, rename libstdc++.so.6 (the file with the arrow) to libstdc++.so.6.old or something like that, so you can go back and undo this if something goes wrong.

Lastly, create a link (not a copy) from libstdc++.so.6.0.22 and rename it libstdc++.so.6. Your files should now look like the ones on my image.

If everything went to plan, the addon should work now.

I hope this is useful for Blenderā€™s Linux community out there.

I use a PC at work and a Mac at home, If I purchase the Windows version , Will I also get to download the MAC version when its available for free?

I know the Mac and Linux versions are not available yet.

Thanks for writing this up! Very useful info and helps me understand the issue!

Yes, all OS versions and future versions will be available at no extra cost. At the moment Windows, OS X, and Linux support is all bundled into one addon file, although Mac/Linux is experimental at the moment. Linux currently has some issues, but there have been no reported issues using OS X yet.

Can the size of the bubbles be randomized, similar to how particle size can be randomized with blenderā€™s particle system?

Hey lumpyoatmeal,

Unfortunately this is not possible at the moment. The particles are rendered through instancing and uses the dupliverts Blender feature to duplicate the particles quickly. This is efficient for rendering when there are millions of particles, but it does not allow for particles of different sizes or shapes. This could be done if the whitewater was a particle system, but Blenderā€™s addon functionality for interacting with particle systems is not flexible enough to implement the whitewater system.

Incidentally, the GLIBCXX version problem is fairly common due to new Linux/C library versions coming out, but the same problem may occur with other libraries. If you encounter anything you suspect may be connected to a versioning problem, the terminal command ā€œstringsā€ is your friend, especially when you restrict the results to the term youā€™re looking for. By itself, ā€œstringsā€ just cuts away all the ā€œgibberishā€ contained in any executable file (such as a library file, ie. *.dll files in Windows and .so files in Linux). When you reduce the results to a particular search term with ā€œgrepā€ , youā€™ll actually get a useable result. For example, strings /usr/lib/x86_64-linux-gnu/libstdc++.so.6 | grep GLIBCXX wil list all occurences of ā€œGLIBCXXā€ in the file /usr/lib/x86_64-linux-gnu/libstdc++.so.6, and if GLIBCXX_3.4.22 isnā€™t among them, you need a more recent version, as desccribed in my earlier posts. Thatā€™s one of the ways to isolate the error weā€™re discussing here. The ā€œstringsā€ command is perfectly safe and doesnā€™t make any changes to your system.

(I hope Iā€™m not going into too much of a detail here, but this may be of some help to Linux users who encounter this kind of error.)

I have gotten it to work on Linux Mint 18.3, by upgrading the libstdc++ to the newer version. I havenā€™t ran all of the test scenes yet. I have done the cascading water feature scene, it took about 10 hours to run the simulation on my GTX980. Iā€™m getting some leaking on the blocker 1 object. Initial playback of the simulation is very slow as well. By frame 520 or so the number of polys is about 3.5 million. I was thinking that the preview should be faster with the lower resolution, but it appears to be using the full resolution?

Awesome work so far, Iā€™m really liking the look of the simulation. :smiley:

Hello! I have such issue(addon v1.0.2). I simulated 190 frames. Then worked with file to render result. I think I didnā€™t change anything related to simulation but I can be mistaken. Then I desided to simulate more frames. I changed end frame to 200 in timeline and clicked ā€˜Resume Baking (from frame 191)ā€™. It staied in ā€˜Baking in progressā€¦ initializingā€™ state for a minute and then just returned to ā€˜Resume Baking (from frame 191)ā€™ without any errors or massages. I canā€™t understand if Iā€™m doing something wrong or my cashe(project file) is corrupted or itā€™s a bug because thereā€™s no messages explainig what going onā€¦

This is a super cool tip, thanks! Iā€™ll play around with this command when I am at my Linux system.

Great to hear youā€™re enjoying the simulation! Playback can be quite slow for high detail meshes due to the large amount of data that needs to be loaded into Blender. There should be a difference between the final mesh and preview mesh. Just tested this out. Do your display settings look like this?:

display_settings

If you want to update the simulation settings (such as frame range), you will need to tell the addon to re-export the settings. This can be done by setting the Bake Export Mode to Force. See the notes on this in the domain simulation settings documentation here (Bake Export Settings).

Glad to be of help! There was a typo in my post, though. The command is ā€œstringsā€, not ā€œstringā€. I corrected the original version.

Thank you!

Thanks RLGUY that was the issue, much faster now. :slight_smile: