wedge_cache
A node that supports writing and reading file caches produced with the wedging service.
This node is intended to be in a graph downstream (to the right of) nodes that output geometric objects. When used locally, the node can let objects pass through it or read the cache of objects from disk. The Read or Passthrough if no File mode can dynamically switch from Read to Passthrough based on whether the files exist on disk. When executed on the cloud-based wedging service though, the node always writes files to disk (see mode input port).
The wedge_cache node can write .bob (Bifrost object), .abc (Alembic), or .vdb (OpenVDB) files (see wedge_filename global variable input).
Usage
- The
wedge_filenameglobal variable indicates the location and type of file caches to be produced. Thewedge_filenamenode used by thewedge_cacheperforms token replacements on thewedge_filenameglobal variable value (see the documentation for thewedge_filenamenode). A path without tokens is also valid for a single cache, but keep in mind that<wedge_index>token should be used when outputting wedges to ensure files do not overwrite between different wedges. After token replacements, thewedge_cachenode also expands the environment variables of the form$nameor${name}that may be present in the input path (see the documentation for theexpand_env_varsnode). - To use wedging, set the
wedge_indexand thewedge_index_countglobal variable values. - Add either a
wedge_indexor awedge_parameternode to your graph to set a parameter that will be varied throughout the range of wedges.
Local wedging could be scripted to loop through all wedges and frames, enabling the hidden write_state global variable, and modifying the wedge_index global variable during the loops. Users can also use the building blocks contained in wedge_cache, wedge_filename and write_state nodes to build their own caching solution if needed.
Global Variable Inputs
By deselecting all nodes in the Bifrost Graph Editor, the list of global variables used by the current graph will be displayed in the Bifrost Parameter Editor.
wedge_filename
The wedge_filename global variable determines where the files are written and read from. The type of files that are written or read is controlled by the file extension present on the path returned by the wedge_filename node. The file extensions supported by the wedge_cache node are .bob (Bifrost object files), .abc (Alembic files) and .vdb (OpenVDB files). Any other file extensions are written and read as Bifrost object files.
wedge_index
The wedge_index global variable specifies the current wedge (0-based).
wedge_index_count
The wedge_index_count global variable specifies the total number of wedges.
write_state
The write_state global variable determines when files are written by the wedge_cache node. Setting the value of this global variable to true will enable file writing, including when the node is executed locally. Just ensure it is turned off after, otherwise there could be unintentional file overwrites locally.
The cloud-based wedging service automatically sets this global variable to true before executing the graph.
When the write_state global variable is true, then the wedge_cache node always passes through the geometric objects from its objects input to its out_objects output.
Inputs
objects
The input geometric objects to be written to file caches and/or to be passed through this node, depending on the mode input, and whether the node is executed locally or not (see also the write_state global variable input).
Settings
mode
The mode determines the behavior of the node when it is used locally:
Read or Passthrough if no Filereads a file cache from disk if it exists. If not, the node will automatically pass though theobjectsinput, so the node still outputs data. This is the most automatic mode, but it can be harder to tell if one is reading from disk or passing through the data.Read Filereads a file cache from disk if it exists. If not, the outputs will be empty.Passthroughbypasses the read of a file cache from disk and passes through theobjectsinput to its outputs.
When the node is executed on the cloud-based wedging service, the mode will be ignored and the node will always write files to disk.
properties
A space-delimited list of properties to write when the wedge_cache node writes files. Use * (asterisk) to specify all properties. For more details on this input, see the documentation for the write_Bifrost_object, write_Alembic and write_OpenVDB nodes. The wedge_cache node uses these nodes internally, and shares the same features and limitations as these nodes for its properties input.
create_directories
If true, the wedge_cache node creates the directory tree structure (specified through the wedge_filename node), if this tree structure does not exist when the node writes the files. For more details on this input, see the documentation for the write_Bifrost_object, write_Alembic and write_OpenVDB nodes that the wedge_cache node uses internally.
Alembic
alembic_interpolation
The interpolation method for interpolating data at sub-frame positions when reading Alembic files (see the documentation for the read_Alembic node).
OpenVDB
volume_subdivision_structure
The volume subdivision structure of the output Bifrost volume when reading OpenVDB files (see the documentation for the read_OpenVDB node).
Outputs
out_objects
An array of objects that have been passed through this node or read from files, based on the mode input and write_state global variable input.
first_object
The first object in the array of out_objects output.
