On this page | |
Since | 18.0 |
Overview ¶
This node takes multiple inputs (each of which represents a “stack” of one or more USD layers) and merges them into a stage containing one layer stack in the output. This is useful when you want to combine separate pieces of a scene graph, each authored by a different chain of LOP nodes, into a unified whole.
-
The order of inputs matters. Layers in earlier inputs are weaker than layers in later inputs when combined in the output.
-
This node has different styles for combining layers from the inputs. See the Merge style parameter. Some styles flatten the contents of input layers into one or more output layers.
Tips ¶
-
This node is like sublayering but for in-memory trees. Similarly, the Graft Stages LOP is like referencing but for in-memory trees. It combines scene graph trees by choosing the locations at which each input stage’s tree is attached on the output tree.
-
Merge styles that simply merge layers are fast. Styles that flatten layers are more expensive. You may want them to generate a particular arrangement of layers when saving the stage to disk with USD render node, but often the same effect can be accomplished in the USD ROP itself by flattening implicit layers. This way the flattening cost is only paid when writing the USD files to disk, not when working in the LOP network.
-
If an input has a Layer Break node further up the chain, the sublayers from above the Layer Break can be discarded for any merge style. This should be done when the Merge LOP has multiple inputs with a common “root” higher up the network (a “diamond” shaped set of connections. In this situation it is a good idea to put a layer break at the branch points for all but the first merge connection. And stripping of layers above layer breaks should be enabled.
-
This LOP will often be much slower to cook the first time, and much faster on subsequent cooks. Factors that may trigger another slow cook include rewiring input connections, changing the Merge Style or Strip Layers parameters on this node, or adding new scene graph primitives to some inputs, especially if the primitives being added or removed overlap with other sections of the scene graph with high prim counts.
-
When merging the outputs of LOP nodes, performance will be best when each primitive in the merged scene is only defined on one input branch. This can be assured by creating diamond shaped network graphs with layer break nodes at the top of all branches but one. This helps LOPs author as many primitives as possible as ampty “over” primitives, rather than “defined” primitives, which after more expensive to compose on top of each other.
Parameters ¶
Merge Style
Separate Layers
Each layer from each input is merged into a new sublayer stack in the output, sorted by strongest to weakest from the strongest (last) input, then strongest to weakest from the next strongest (second-to-last) input, and so on.
This includes layers from above a Layer Break node, which allows such layers to continue to provide context for all subsequent layers.
Separate Layers, File Layers Weakest
Like “Separate Layers” (above), except that any sublayers that refer to existing layer files on disk are ordered to be weaker than any layers authored purely in the LOP network.
This is useful when combining several LOP node streams where each stream begins with one of more file layers, then applies modifications to a new layer on top of that layer. After merging these streams, all the LOP-authored modification layers will be adjacent to each other in the sublayer list for the stage. This allows all these new layers to be flattened into a single layer by the USD ROP without also flattening the layers from disk. (In the regular Separate Layers mode, layers from disk would alternate with layers authored in LOPs, and each LOP layer would have to be saved to a separate new layer on disk.)
Note
This option can change the result of composing the stage if the opinions from layers on disk were intended to be stronger than opinions authored in the LOP network.
Separate Layers, File and SOP Layers Weakest
Like “Separate Layers, File Layers Weakest” (above), except that sublayers imported from SOP nodes are also sorted with files loaded from disk, appearing before any layers authored purely in the LOP network.
This is useful when you want the layers authored from SOPs to be saved to separate layers rather than flattened together with the layers authored in the LOP Network.
Flatten Layers
All layers from all inputs are flattened together into a single output layer.
Layers from above Layer Break nodes are removed prior to flattening and so do not contribute to the output.
Flatten Into First Input’s Active Layer
The layers on the first input are passed through without flattening. All layers from all other inputs are flattened into the active layer of the first input.
Layers from above Layer Break nodes other than on the first input are removed prior to flattening and so do not contribute to the output.
Flatten Each Input
For each input its layers are flattened, and then the flattened inputs are merged into a new sublayer stack in the output.
Layers from above Layer Break nodes are removed prior to flattening and so do not contribute to the output.
Simple Merge
The layer stacks from each input are combined, and sorted such that sublayers from files on disk or representing SOP nodes are made weaker than layers authored by LOP nodes. Then the layers authored by LOP nodes are flattened into a single layer that becomes the active layer for the Merge LOP. This provides a very simple and intuitive behavior in terms of combining LOP-authored layers from multiple inputs, without pulling data from disk or SOPs into this combined layer.
Note that as with any operation that reorders layers, it is possible that the relative strength of some opinions may change. Specifically, after this operation, opinions from files on disk will all be weaker that any opinions authored on sublayers in the LOP Network.
Strip Layers Above Layer Breaks
Enable this option to remove all layers created above Layer Break nodes on every input to this node. This option is useful when creating diamond shaped node graphs, where on one branch the top of the diamond connects to the merge at the bottom of the diamond without a Layer Break, and the other branch(es) use Layer Breaks. Without this option, in any of the Separate Layer modes, the layer stack would include two copies of every layer created above the Layer Break, which degrades performance without affecting the final composed stage.
Merge styles which cause layers from inputs to be flattened always strip layers above Layer Breaks, and so will hide this parameter. This is because layers cannot be stripped after they have been flattened. The 'Flatten Into First Input’s Active Layer' merge style is a special case which flattens (and therefore strip layers) from all inputs after the first input. Note that layers above Layer Breaks will not be stripped from the first input in this mode.
See also |