- To explain writing out to VDB let's create a default fire simulation. Ctrl+click Sphere on the Create shelf and then click on the Flames button on the Pyro FX shelf. Press play to let the simulation run through.
- There will now be three nodes at scene level; the sphere, which has been converted to fuel, the AutoDopNetwork, which contains the simulation and import_pyro_build which visualizes the result in the viewport.
- Before exporting, lets increase the quality of the simulation. Go inside the AutoDopNetwork and select the pyro node on the left. Decrease Division Size to your desired amount. For this example 0.025 was used.
- To start the process of exporting to VDB, switch to inside the import_pyro_build node.
- Inside, there are 2 DOP import nodes, import_pyrofields (purple for rendering) and import_pyro_visualization (blue for viewport display only). Import_pyro_visualization contains the density, heat and temperature grids. Import_pyrofields holds the same grids and the additional fuel and velocity grids. Keep in mind that the more grids are exported the larger the VDB file size will be on disk.
- The volume needs to be converted to VDB before writing. Tab-create a Convert VDB node and connect it below the import_pyrofields node. Select the convertvdb1 node to set the parameters for conversion. Use the arrow to the right of the Group box to select the grids to export. From the visualization node you will be able to choose from density, heat and temperature. They should be written in the format @name=fieldName. Change Convert To to VDB.
- Connect a file node to the convertvdb1 and change File Mode to Write Files and enter a file location to Geometry File. Add the variable $F to write out multiple frames.
The network should now look like the image below.
- Play through the sequence to write out all the files. After writing, it's a good idea to change File Mode to No Operation so it doesn't keep writing out any changes you make to the simulation.