|On this page|
You may want to use the Graft Branches node instead. It allows you to graft specific prims from a second input rather than entire stages, and to offset time samples.
Unlike referencing in a file with the Reference LOP, this node is more for performing “surgery” on anonymous in-memory layers to build them into a tree you want to write out. It flattens the prims from the other inputs and directly attaches them in-memory to the tree in the first input, rather than creating a composition arc.
Because USD does not directly allow copying or deleting of stage contents, this node flattens the layers of each other stage (preserving references) into a single layer, and adds the contents of that flattened layer to the active layer of the first input.
Where to attach each sub-tree
By default, all destination paths are added under the scene graph path you set in Primitive path. The default is the path of the last modified prim in the first input. You should change this to the parent prim under which you want to attach the trees in the other inputs.
For each wire connected to the multi-input, you can specify a sub-branch under which to attach the root prims from that input. In the input table below the Graft Stages node’s parameters, click the Destination Path column next to the input, type a primitive path, and press Enter.
When you type any custom destination paths for an input, the custom paths are appended to Primitive path. This means custom destination paths are always under whatever prim you set in Primitive path. If you want to be able to specify root prims as the parents, set Primitive path to
If you don’t set a destination path for an input, one is computed using the expression in Destination path default. The default is a prim with the same name as the node wired in.
Say you have this scene graph tree in the first input.
/Models /Effects /Render
In another node chain you build a prop, for example using SOP Create, and connect it to the multi-input, with a tree like this:
/teapot mesh0 mesh1
The following table shows how different values in the Primitive path and the second input’s Destination Path lead to different graft locations:
/Models prop1 teapot mesh0 mesh1 /Effects /Render
/prop1 teapot mesh0 mesh1 /Model /Effects /Render
/teapot mesh0 mesh1 /Model /Effects /Render
This node is like referencing but for in-memory trees. Similarly, the Merge LOP is like sublayering but for in-memory trees. It creates a stage that combines the sublayers of several input stages without altering the scene graph hierarchy.
If an input chain has a Layer Break node further up the chain, the sublayers generated above the layer break will not be combined into the flattened layer that gets grafted into the active layer. Because this can involve a loss of scene graph information, this node will generate a warning in this case.
If this node generates a path where intermediate prims do not exist yet, it will create them. The Parent primitive type parameter controls the type of any intermediate prims this node creates.
The parent scene graph path of all grafted sub-trees. The “destination path” of each subtree is appended to this path. See “Where to attach each subtree” above.
If the parent prim in Primitive path does not exist, it will be created, and set to be this kind. If the prim already exists, this parameter does nothing.
Parent Primitive Type
If this node generates a path where intermediate prims do not exist yet, it will create them. This controls the type of any intermediate prims this node creates.
Make Destination Primitive Paths Unique
It is possible to set multiple inputs to have the same destination path. If this parameter is off, the trees are merged. If this is on, the node adds increasing numbers on to the end of each destination path until it is unique.
Destination Path Default
You can set the destination path (which is then appended to the Primitive path) for each wire into the multi-input by clicking in the table below this node’s parameters. If you don’t give an input a custom destination path, the node evaluates this expression to compute destination path. The default is the name of the node connected into the multi-input.
In the expression you can use the
@input local variable (
$IIDX is deprecated) as the index of the current input (numbered from left to right starting at 0).