Learn about storing liquid simulation startup conditions.
- [Instructor] Initial state is a very helpful feature that allows you to store the start conditions for a simulation. I'm going to press Play in this scene and allow the simulation to run as I explain what's going on here. Initial state is a one frame cache that is loaded automatically on the first frame of the simulation. In this scene, I have had a very long run up to the current state of the simulation. After about 30 seconds, we'll get to frame one and we'll be able to see that there are a lot of particles in the shot.
The particles that we see at first are the Initial State conditions for the simulation. As the simulation progresses, it becomes a live simulation that's being calculated on the fly. I did this in order to avoid a long run up to the current frame because it took tens of hours to calculate the simulation, such that the particles made it all the way down into the gully here. This is a situation in which Initial State is incredibly helpful.
I'll hold down the Escape key and cancel the simulation. Because these are taking about 30 seconds per frame to simulate, you may need to hold the Escape key down for a while. Once again, I recommend monitoring the Windows Task Manager or the Apple Activity Monitor in order to know when the CPU usage drops back down to zero. Then you'll know that the simulation has indeed stopped. Let's investigate, go over to the Outliner and select bifrostLiquidProperties1, and in its Attributes, open up the Caching section down here, and we can open up Liquid Cache, and we'll see that there's nothing there.
Also, the same for Solid and Mesh Caches, they're disabled, and those path fields are empty. But in the Initial State Cache, we're pointing to an individual BIF file. Let's see how to set this up. I've got another scene that will run much more quickly that's better for the demonstration. In this scene, I have a small scale simulation with a master voxel size of one millimeter, and it's just enough to get a convincing look for water filling up a tumbler here. Once again, we can press the Play button.
The simulation starts on frame one, and we'll see the fluid represented as a bunch of spheres. Let that simulation play out for 10 or 15 frames until the liquid settles down. It should settle down pretty quickly, because I have a very high magnitude motion field applying a drag force. When it looks like those particles have stopped moving, then hold down the Escape key to cancel the simulation. Now we can set this state as the initial start point for the simulation.
Select the bifrostLiquid1 and go into the Bifrost Fluids menu, and choose Initial State > Set Initial State... > Options. Double-check the path here and make sure that it's going to create the correct folder, and it's just going to inherit the name of the current scene file. Go ahead and click Save Initial State, and in the timeline, we can rewind back to frame zero and the particles all disappear, and then press Play, and on frame one, the particles should be already settled down.
The simulation will continue running, but because there are no forces acting upon the scene, and additionally, because I have that motion field with a very high drag, nothing's going to move. If you want to remove the Initial State, then you can do that from the menus, there's a Clear Initial State item in the menus. But I would recommend simply going into the LiquidProperties node to the Caching section and disabling or repathing the Initial State here. That's how to use Initial State to set the start conditions for a simulation.
- Bifröst basics
- Analyzing the node structure
- Emitting from a polygon mesh
- Colliding with a polygon mesh
- Adding velocity, friction, and drag with motion fields
- Optimizing space and time accuracy
- Caching simulations
- Meshing and exporting liquids
- Render-time meshing in Arnold
- Applying channel data to Arnold shaders
- Generating foam from a liquid
- Rendering and shading foam in Arnold