Share

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

  1. Set a file path for the cache of your simulation in filename. It may contain environment variables, such as $HOME for your home directory.
  2. Plug the output of a simulation into objects and use out_objects as the output, or first_object to avoid conversion to an array.
  3. Go to the start frame of the simulation.
  4. Set mode to lazy mode.

mode

  • Lazy mode switches 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 mode pull upstream and writes frames and passes geometry through.
  • Read mode does not pull upstream and reads frames, outputting the geometry.
  • Passthrough mode always pulls upstream, does not write anything, and passes geometry through.
  • Write State mode read a cache if it exists, passthrough upstream data if there isn't a file on disk, and then only write files when write_state job port 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.

Was this information helpful?