Set the initial state for a Bifröst liquid and foam simulation

Some simulations need a run-up before they look good. For example, in the case of water cascading down over rocks into a pool, it can take many frames for the water to reach the bottom of the rocks and for the foam to create swirling patterns. In these situations, you can set an initial state — that is, you can run the simulation for as many frames as you want, and then set the current frame to be the new starting point for subsequent runs of the simulation. In this way, you avoid the need to run up again every time you adjust the simulation settings.

Once you have set the initial state, you can change any aspect of the simulation and it will continue from that starting point with the new settings. You can even change the Master Voxel Size, and all values will be resampled at the new resolution. In particular, you can play a simulation at low resolution to quickly get to the overall shape of the flow that you want, then set the initial state, and finally decrease Master Voxel Size to continue from there at a higher resolution.

To set the initial state

To set the initial state, or to change it to a later frame if it is already set:

  1. Set up a Bifröst liquid simulation, with or without foam as desired.
  2. Play the simulation through until it reaches a frame that you want to use as a starting point.
  3. Select the bifrostLiquid node.
  4. Select Bifrost > Set Initial State.

    The current state of the liquid (and foam, if any) is saved in .bif files, by default in subfolders of the cache directory of the current project, based on scene and object names. In addition, the Initial State Cache attributes are automatically set to the appropriate values in the Caching group of the bifrostLiquidProperties and bifrostFoamProperties nodes.

  5. If the simulation involves no animated objects such as emitters, colliders, fields, guides, and so on, then you are finished.
    However if there are animated objects, then the animation and simulation no longer match each other. On the first frame, the simulation now corresponds to the frame that has been set as the initial state, but the animation of the objects is unchanged. The best way to re-synchronize them is:
    1. In the bifrostLiquidContainer attributes, set the Start Frame to the frame used for the initial state.
    2. Set the start of the scene's animation or playback range to the same frame as well. For more information, see Range Slider.
Note: If you set the initial state for a liquid-only simulation, and then add foam to it, it may take a few frames for the foam to fully form. If you then set a new initial state, both the foam and the liquid use the new frame as their initial state — this ensures that the position and velocity of the foam match the liquid at all times.

To clear the initial state

To stop using an initial state:

  1. Select the bifrostLiquid node.
  2. Select Bifrost > Clear Initial State.
  3. Click to confirm. If an initial state is currently set for both liquid and foam, there are separate confirmation dialog boxes for each. For example, you can click No to keep the initial state for the liquid and then click Yes to remove the initial state for the foam.
  4. If necessary, change the bifrostLiquidContainer's Start Frame, as well as the start of the scene's animation or playback range, back to their original values.

The next time you play back, the simulation will be recomputed from scratch.