file_cache
An experimental node which can cache and read back simulations by writing them to a file.
This node is intended to be in a graph downstream (to the right of) a simulation. It can cache the simulation to disk or read the cache of the simulation from disk. Lazy mode can dynamically switch from "read" to "write" based on whether the files exist on disk.
It can write .bob (Bifrost Object) files, Alembic, or OpenVDB files. File types are controlled by the extension on the filename parameter - files ending in ".abc" are written as Alembic, ".vdb" as OpenVDB, and ".bob" (or anything other extension) are written and read as Bifrost object files. properties controls which properties are written and read from those files.
In write mode, if the tree structure does not exist it will be created if create_directories is set to true, otherwise any writing operation will fail.
Usage
- Set a file path for the cache of your simulation in
filename. It may contain environment variables, such as$HOMEfor your home directory. - Plug the output of a simulation into
objectsand useout_objectsas the output, orfirst_objectto avoid conversion to an array. - Go to the start frame of the simulation.
- Set mode to
lazy mode.
mode
Lazy modeswitches between read and write mode depending on whether or not a frame exists on disk. This mode can be used as a scrubbable, resumable cache.Write modepull upstream and writes frames and passes geometry through.Read modedoes not pull upstream and reads frames, outputting the geometry.Passthrough modealways pulls upstream, does not write anything, and passes geometry through.Write State moderead a cache if it exists, passthrough upstream data if there isn't a file on disk, and then only write files when write_state global variable is set.
Alembic and OpenVDB settings
For more detail on settings such as volume_subdivision_structure and alembic_interpolation see the documentation on read_Alembic and write_OpenVDB. These nodes are used internally. File cache shares the same features and limitations of these nodes.
Frame Range
If active_frame_range is enabled, then the node defaults to passthrough behavior outside of the specified frame range specified by start_frame and last_frame. If invert_frame_range is enabled, then it switches to passthrough behavior inside the specified frame range.
