Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Baking from the Command Line
It is possible to run a FLIP Fluids simulation from the command line without opening the Blender interface. This document will detail how to bake your .blend file simulation from the command line. You will need to have basic knowledge of how to use your OS command line utility to follow this document.
Baking a Simulation
This method will bake your simulation exactly as if you had pressed the Bake operator within the the Blender interface. That means that if you have a paused simulation, this method will resume the simulation from the last computed frame!
First, you will need to create a very simple Python script to tell Blender to begin baking the FLIP Fluids simulation. You may save this script as
import bpy bpy.ops.flip_fluid_operators.bake_fluid_simulation_cmd()
Next, you will run Blender from the command line and tell it to run the above script in your simulation blend file. Open your command line utility and run the following command:
blender --background file.blend --python run_simulation.py
Your simulation should now be running! The addon will display simulation progress to the command line.
Here is an example of how to use the command in the above section on the Windows operating system using CMD. Let's assume that:
- Your Blender executable is located here:
C:\Program Files\Blender Foundation\Blender\blender.exe
- Your simulation file is located here:
- Your simulation script is located here:
Then your fully formed command to bake the simulation would be:
"C:\Program Files\Blender Foundation\Blender\blender.exe" --background "C:\Users\Ryan\Documents\my_simulation.blend" --python "C:\Users\Ryan\Documents\run_simulation.py"
Resetting a Simulation
You can also reset a simulation from the command line! You would run the same command as in the above section except that you would use this Python script instead:
import bpy bpy.ops.flip_fluid_operators.reset_bake()