Flow Wedging walkthrough
Here is a quick overview of the basic steps for wedging the output of a Bifrost graph using the technology preview of Flow Wedging. If you prefer to look at an example that's already set up, try the aero_commbustion_wedging
sample graph that's available in the Bifrost Browser.
Load the Flow Wedging plug-in
The Flow Wedging plug-in is installed with Bifrost for Maya, but it might not be loaded.
Open Maya's Plug-in Manager: Windows > Settings/Preferences > Plug-in Manager.
Make sure that
flowWedging.py
is loaded.If you'll be wedging often, you can set it to Auto load.
Prepare the graph for wedging
Flow wedging requires special nodes in the graph: mainly wedge_cache
for writing and reading the cache files, as well as others like wedge_parameter
to determine the variations.
Before you start, it's a good idea to remove unnecessary properties from the objects that you will be wedging. For example, for a combustion effect, you may need only the
voxel_fog_density
,voxel_temperature
, andvoxel_velocity
for rendering the result and you can erase any other properties that are used only for computing successive frames. This helps to keep the size of the downloaded cache files to a minimum.- Use a watchpoint or a data browser to see the properties that exist on the object. See Diagnose and debug graphs.
- Use
erase_property
orerase_component_properties
to remove data that you don't want in the final caches. Make sure to leave properties that are essential to the object's geometry type, such as*_component
,*_offset
,voxel_tile_tree
, and others. - If desired, you can cache out a few frames locally using the regular
file_cache
node to check their file size.
Add a
wedge_cache
node to the top level of the graph, and connect the objects to be wedged into theobjects
port.- The output of the
wedge_cache
node must eventually lead to anoutput
node. Wedging does not work if it is connected only toterminal
nodes. - It's usually best to assign a material before the
wedge_cache
node so that the material will be included in the caches (as well as preview renders if you generate them). The exception is when you plan to use the VDB format for caches — the VDB format does not support material assignment, so assign the material afterwedge_cache
to ensure that the material is properly applied after the cache files have been read. - Use only one
wedge_cache
node per graph. Flow Wedging will process only the first node it finds in the graph that's selected for a job. However, you can connect multiple objects to theobjects
fan-in port to process several objects as an array. - By default, the
wedge_cache
node'smode
is set to Read or Passthrough if no File. In this mode, it will automatically read the cache files once they exist later in this procedure but since you have not downloaded any cache files yet, it instead evaluates the upstream nodes and simply passes the result along to the downstream nodes.
- The output of the
Connect a
wedge_parameter
node into an input that you want to vary, and set thestart
andend
values for the range you want to test. The wedges will be evenly spaced between these values based on the number of wedges that you specify in a later step. For example, if you have only one wedge then it will be evaluated at the midpoint betweenstart
andend
; two wedges will be evaluated exactly atstart
andend
; three wedges will be evaluated atstart
, the midpoint, andend
; and four wedges will be evaluated atstart
, 1/3 of the range, 2/3 of the range, andend
.- By default,
start
andend
areauto
ports that are set tofloat
type. To vary another type such asvector3
, right-click on either port and select a different value type or connect a value of the desired type. - You can use multiple
wedge_parameter
nodes to vary multiple inputs. However, they will not be varied independently — instead the values will be varied in lock-step between their respectivestart
andend
values based on the wedge being evaluated. - If you do not use any
wedge_parameter
nodes, you can still submit a job. This may be useful if you simply want to offload the generation of cache files to the cloud without any wedging. - As an alternative to
wedge_parameter
, you can usewedge_index
to return the index of the wedge being evaluated (0, 1, 2, etc.) and use custom logic to specify the input value for each case.
- By default,
At the top level of the graph, deselect all nodes. The job ports of the graph appear in the Parameter Editor. Set the Wedge values as desired.
Wedge Filename
is the full path and file name for downloading the caches. A path without tokens is valid for a single cache, but keep in mind that the<wedge_index>
token should be used to ensure that different wedges do not overwrite each other's files. Environment variables of the form$name
or${name}
can be used, and will be expanded after takens are replaced. The extension determines the format of the cache files:.bob
for Bifrost object files (any objects),.abc
for Alembic files (meshes, particles, strands), or.vdb
for VDB files (volume). Any other extension will be written as Bifrost object files.Wedge Index
specifies which set of cache files to read once they have been downloaded. It can also be used to specify which wedge to evaluate if you choose not to evaluate all wedges in a single job.Wedge Index Count
sets the total number of wedges that you want to evaluate. It is also used to calculate the fraction of the range between thewedge_parameter
nodes'start
andend
values. The maximum number of wedges per job is 4.
Set up preview rendering (optional)
Flow Wedging can generate Arnold preview renderings that you can inspect in the Flow Job Monitor. Note that there are several limitations and the workflow may change in the future. In particular:
- Only Bifrost object (.bob) caches are supported.
- Materials must be assigned to the cache inputs in the graph (not to the cache outputs) using
assign_material
or a similar node. - Materials must be defined in the graph (for example, using
standard_surface_mat
orArnold_standard_volume_mat
) rather than referenced from the host scene. - GPU rendering is not supported. Make sure that Render Device is set to CPU on the Device tab in the scene's Render Settings (Arnold Renderer).
In the Maya scene, create a transform group and name it
preview
.Under this group, parent any lights that you want to use for the previews.
- You can additionally parent any extra geometry that you want to include in the previews.
- If there are multiple renderable cameras, you can specify the one to use by including it under the preview group.
Submit the wedging job
Once the graph has been prepared for wedging, you are ready to submit the job.
Choose Flow Graph Engine > Flow Wedging (Technology Preview) > Create New Job from Maya's main menu. After you sign in to your account if required, the Flow Job Monitor window launches and the Create Flow Wedging Job dialog box opens:
Set the options as desired:
- If the scene has multiple graphs with
wedge_cache
nodes, make sure to set Graph Shape to the one that you want to evaluate for this job. - Set Wedge to evaluate the current wedge only, or all wedges.
- Job Name is used only to identify the job in the Flow Job Monitor.
- Set Start Frame and End Frame if you want to evaluate a different range than the scene's time slider. However, note that simulations must start from the first frame.
- If you set up preview rendering, set those options as well.
- If the scene has multiple graphs with
Click OK. The graph and any connected scene objects are uploaded to the Flow Wedging service and the Flow Job Monitor shows progress.
You can close the Flow Job Monitor while the job gets computed in the background, and then choose Flow Graph Engine > Flow Wedging (Technology Preview) > Open Job Monitor to re-open it at any time to monitor progress. Click on a specific job to view details, log files, play through preview renders, and and more.
Download the cache files
The cache files get downloaded automatically if you left Download Job Results checked when you submitted the job. You can also download them manually from the Flow Job Monitor if you unchecked that option, quit your Maya session before the download was complete, or simply need to download them again.
Cache results are available for download for 30 days. If you delete a job, the cache results cannot be recovered.
Open the Flow Job Monitor.
Locate the job to download, and click Download.
Select a wedge, if there are multiple wedges in the job.
Select the items to download (for example, All or Only logs).
Browse and select a folder on your disk for the downloaded files. You do not need to select the Wedge Filename location that was set on the
wedge_cache
node, but note that the graph will not read the downloaded cache files until you update that parameter with the new location.
View the downloaded cache files in the scene
You can begin scrubbing through the results in your scene as soon as first few frames of a wedge are available.
At the top level of the graph, deselect all nodes.
Set
Wedge Index
to the index of the wedge you want to view: 0 for the first wedge, 1 for the second, and so on. You may need to change the frame to see the viewport update.Play through or scrub the timeline.