On this page | |
Since | 17.0 |
Overview ¶
Because USD only allows non-destructive edits, the two methods to “remove” something from the scene are to hide it or deactivate it.
-
Deactivated prims and their children will not be traversed or processed by USD functions or LOP nodes. Children of deactivated primitives don’t appear in the Scene Graph Tree.
-
Hidden prims their descendants and are still processed by USD functions and LOP nodes, but are not shown in the viewport or rendered.
You can write an override of the activation/visibility data of a prim into the active layer, so when it is composed with the lower layers, in the output stage the prim is deactivated or invisible.
For example, the lighting department might deactivate scratch lighting from a layer they receive from the layout department.
Tip
You can see the visibility and activation state of prims in the scene graph tree pane.
How to ¶
-
Use the Target Rules multi-parm to select primitives using various methods. Exclude specific primitives from the target primitives using Add Exclusions.
-
Set Method to Make Invisible or Deactivate, depending how you want to “remove” the selected prims.
-
Perform an isolate operation by turning on Prune Unselected and targeting the primitives that should not be pruned.
Tips and notes ¶
-
For this node to prune a prim, the prim must pass the Target Primitives rules, and then (after the matching set is inverted if Prune Unselected is on) it must match the Prune Restrictions pattern (if any).
-
Since the Prune Restrictions pattern is applied after the matching set is possibly inverted by the Prune Unselected checkbox, you can use it to easily refine the contents of the inverted set. If Prune Unselected is off, you may find it easier to simply add another target rule to achieve the same effect.
-
You can turn on Add Exclusions to add rules that subtract primitives from the matching set. This makes it easy to express things such as “prune everything in this branch except these five specific prims”.
Parameters ¶
Prune Unselected
Reverses the meaning of the node, so it hides or deactivates prims that are not selected by the rules above.
Target Rules
You can specify multiple rules for what prims to prune. Set the number of include rules, or click the plus and minus buttons to add or remove rules. If Prune Unselected is enabled, these primitives are the ones that will not be pruned.
Enable
Turn off this parameter to disable a target rule, causing the node to behave as if the associated target rule doesn’t exist.
Target Method
This LOP provides several different methods for selecting which primitives to prune. This parameter controls which method to use, which in turn affects which other parameters are available for controlling the primitive selection.
Primitive Pattern
When the Target Method is Primitive Pattern, this parameter specifies which primitives to prune. You can drag primitives from the scene graph tree pane into this textbox to add their paths, or click the select button beside the text box to select the primitives in the viewer. You can also use primitive patterns for advanced matching, including matching all prims in a collection (using /path/to/prim.collection:‹name›
).
Bounding Box Rule
When Target Method is Bounding Box, the rule used to determine what kind of comparison is done between the prim’s bounding box and the target bounding.
Fully Inside
The prim’s bounding box must be fully contained by the specified bounding box. If any part of the prim’s bounding box is outside the target bounding box, this prim will not be pruned.
Fully Outside
The prim’s bounding box must be fully outside the specified bounding box. If any part of the prim’s bounding box is inside the target bounding box, this prim will not be pruned.
Partially or Fully Inside
If any part of the prim’s bounding box is inside the target bounding box, this prim will be pruned.
Partially or Fully Outside
If any part of the prim’s bounding box is outside the target bounding box, this prim will be pruned.
Bounding Box Size
When Target Method is Bounding Box, the XYZ values to define the dimensions of the bounding box.
Bounding Box Center
When Target Method is Bounding Box, the XYZ coordinates where to place of the bounding box.
Primitive Type
When Target Method is Primitive Type, the USD prim type of prims to be pruned.
Primitive Kind
When Target Method is Primitive Kind, the USD prim kind of prims to be pruned.
Primitive Purpose
When Target Method is Primitive Purpose, the USD purpose of prims to be pruned.
Vexpression
When Target Mode is Vexpression, you can enter custom VEX code here.
Create Missing Explicit Prims as Overs
If a list of explicit prims is provided, when Target Method is set to Primitive Pattern, any prims that do not yet exist will be created as over prims with their active or visible state set accordingly. This allows you to effectively predeclare specific prims' visibility or active state.
Note that exclusions and restrictions will have no effect on any newly created prims.
Add Exclusions
Show another multi-parm for creating exclusion rules. Prims that match the exclude rules are subtracted from the list of prims that match the target rules to get the final set of primitives to prune or keep.
Exclude Rules
You can specify multiple rules for what prims to exclude. Set the number of exclude rules, or click the plus and minus buttons to add or remove rules.
Method
Deactivate
Sets the active metadata on the selected prims to false.
Make Invisible
Sets the visibility of the selected prims to “hidden”.
Prune
When this value is non-zero, the node prunes the matching primitives. If this is 0
, the node instead un-prunes the matching primitives, making them explicitly active or visible. This parameter allows you to control the prune/un-prune operation with keyframe animation or an expression (for example, you could prune out the “unfractured” version of an asset at the frame where a fracturing simulation starts). In USD terms, this authors an opinion at each time step about the active/visible property of the primitives.
This parameter is evaluated separately for each primitive that will be modified by this node. you may use the following local variable in this parameter only
@numprim
The total number of primitives being modified by this node.
@prim
Index of the primitive being modified. This value goes from 0
to @numprim-1
.
@primpath
The path of the primitive being modified.
Note
This will not affect the visibility of ancestor primitives, so the selected primitives may still not be visible. Use the Configure Primitives LOP to guarantee the visibility of certain primitives.
Prune Restrictions
This node only works on primitives that match this pattern. This lets you add further refinements to the targeting. For example, you can only affect a portion of the scene graph, or only prune primitives with geometry, or only prune Component kinds.
Prune Point Instances Individually
When pruning a point instancer prim, prune the instances individually instead of the entire instancer at once. This is currently only supported when pruning by bounding box.
Prune Ancestors Automatically
If all children of a primitive are being pruned, that parent primitive is pruned instead of pruning the children individually. This rule is applied recursively. This makes the prune operation much more efficient (at the expense of making it slightly more complicated to re-activate or display one of the pruned children). You should leave this on unless you want to un-prune individual children later.
Prune Class Primitives
Enable this option to allow the Prune LOP to affect class primitives (also known as abstract primitives). This option is disabled by default because normally when pruning parts of a scene, it is the individual prims inheriting from classes that you want to prune. Class primitives themselves are never rendered, so there is little reason to prune them from the scene. However it is sometimes useful to prune class prims as a way of pruning all inheritors of that class.
Create Collection
Creates a USD collection with all the primitives that were modified by this node.
Collection Primitive
The primitive on which to create the collection. If the specified primitive does not exist, the node will create it.
Collection Name
The name of the collection to create.