Saturday, September 19, 2020

Compiling flip fluids in windows using mingw, cmake and cmd

This worked for me in blender 2.90

3 locations I found useful:

1. a reddit post (see below)

2. the actual README.md that comes with the git sources

3. installation:  zip this folder build\bl_flip_fluids into one zip file and then in blender, edit->preferences->add ons-> install-> double click that file and after that add a checkbox to it and exit preferences


To test that it works: see this video https://www.youtube.com/watch?v=44n3z3g9sVc from 14:20

(the whole video shows compiling with visual studio which is problematic so just go to the location for testing)

REDDIT POST

I found this archived reddit thread that was useful (unfortunately it is archived so couldn't add to it a small correction to make it work in red below - i will copy it here too):

-- credit and thanks to u/Blocks_ --



The above was built from the code on the GitHub repository, which is under the GNU General Public License. This license allows for redistribution. Unfortunately, I cannot provide binaries for MacOS or Linux since I only run Windows. Also, note that the above download is for Blender 64-bit (which should be the default on the blender.org downloads page). The GitHub version also doesn't include the cool materials.

As with anything you find on the internet, make sure you're not downloading anything sketchy. I've left compilation instructions in case you don't trust my pre-built binaries.


Installation instructions
  1. Download the .zip file from the link above.

  2. Go to your Blender addons folder (e.g. C:\Program Files\Blender Foundation\Blender 2.81\2.81\scripts\addons).

  3. There is a folder called flip_fluids_addon inside the .zip file. Drag this folder into Blender's addons folder. Make sure to drag the folder and not the contents!

  4. Start Blender and enable FLIP Fluids. In Blender 2.81, you do Edit->Preferences->Add-ons, then search for FLIP Fluids and check the box. I had to start Blender as an administrator for this step but you might not need to.

  5. Close Blender and start it again. Again, I had to start as admin but you might not need to.

  6. Everything should be good to go!

Compilation instructions

You shouldn't need to compile it yourself if you just want to use FLIP Fluids (I've done that for you), but here are the instructions in case anyone wants them.

  1. git clone the repo or download the .zip from the GitHub repository. If you got the .zip, extract it to somewhere on your computer.

  2. Install Mingw-w64 from the Sourceforge link here. Make sure to select posix threads instead of win32 threads. Also make sure to select the i686 architecture if your Blender is 32-bit, or select x86_64 if your Blender is 64-bit. Take note of your installation directory since it'll be important for the next step.

  3. Add your installation directory's bin folder to your PATH. The default should be something like C:\Program Files (x86)\mingw-w64\i686-8.1.0-posix-dwarf-rt_v6-rev0\bin. Google how to add a folder to PATH if you don't know how to do this step.

  4. Install CMake from here. Make sure to add CMake to the system PATH in the installation setup. It does not matter whether you add it for all users or just the current user, but I would recommend selecting the current user option.

  5. Go to your FLIP Fluids files from step 1.

  6. Create a folder called build and enter it.

  7. Open a Command Prompt/Powershell window in this build folder.

  8. Run the following command in CMD/Powershell: cmake.exe -G "MinGW Makefiles" ..

  9. [Original that didnt work for me: Now run this: cmake.exe --build ] New: change this to "mingw-make"

  10. After the build process has finished, you should see a folder called bl_flip_fluids in the build folder. There should be a flip_fluids_addon folder inside your bl_flip_fluids.

  11. Now follow the Installation instructions section above, but ignore the .zip stuff. The folder you need to drag in Installation instructions step 3 is the flip_fluids_addon that we just built.


Hopefully someone found this useful! Have a great day! <3