Using Paths and Masks to Control the Scene

In the New 3D system, Path and Mask knobs are available for nodes that create or import geometry, and allow you to specify where imported objects live in Nuke's Scene Graph based hierarchy.

Path Knobs

Path knobs allow you to specify which parts of your Scene Graph you want to affect. When inserting a 3D node to modify geometry such as GeoCard, the Path knob defaults to {nodename}. This expression is created by Nuke, to make sure that unique ID is always created and you don't have to worry about populating this yourself if you don't want to.

Custom Paths

If you would like to customize where your geometry lives in your Scene Graph, you can do this by typing to edit the Path field.

For example, here we have added a couple of higher levels in the hierarchy above the Card which has been named Card001.

This hierarchy is automatically updated in the Scene Graph and any missing parents are automatically created.

If you then create a second object like a Cube, and edit the Path to be under the same hierarchy, you’ll be able to connect it directly under the GeoCard node without the need for a Merge node, similar to how Nuke's 2D nodes function.

Mask Knobs

You can find the Mask knob in modifier nodes such as GeoTransform. The Mask knob is a dropdown, allowing you to select the most appropriate mask from a range of common options such as All roots, Last modified, All Cameras, All Lights and All meshes, or choose your own Custom mask.

The Mask knob defaults to All roots or All meshes, depending on the node. This option is an artist friendly way to have this node just affect the top most level Xforms in your Scene Graph.

For example, if you have both a Card and a Cube, this expression is telling the GeoTransform node to select all objects in Scene001:

Tip:  The All roots and All meshes options can help to avoid issues with ordering in the node graph as it selects all objects in the hierarchy.

Underneath the Mask dropdown, the mask field automatically updates based on your selection in the dropdown, helping to show how the mask is being created with expression language, and allowing for easier manual editing if needed.

In this case, the field underneath displays /* as this is the equivalent expression for All roots. This expression essentially says to select everything from the root of the scene graph down and therefore we are able to modify all nodes in the chain.

Note:  We could also manually add objects to the Mask path by dragging and dropping them from the Scene Graph, picking from the Scene Graph or Viewer, or copying your current selection. For more about this, see Using Masks and Paths in the Scene Graph.

In addition, to help with setting up masks, there is a Select Path Mask button to the right of the mask field.

Selecting this button will select all the prims of your mask in the Scene Graph and in the Viewer, helping you to understand what your mask is acting on.

Advanced Path and Mask Workflows

You can create more complex selections with these knobs using expressions and tokens. The knob expression language is based on a simplified version of the Cell Expression Language (CEL) which is what we use in our sister product Katana.

For example, GeoTransform is a geo modifier node, so the Mask knob defaults to the option All roots. With the expression /*, all we're doing is using / to say go to the root of the scene graph hierarchy and then * to indicate we want to select everything underneath the root.

We can expand on this selection by using * to indicate select everything with a given text string.

For example, taking a simple scene with various types of meshes:

We could edit the mask field in a variety of ways:

Expression

What it does

/scene/objects/cube1

Selects the single object “cube1”

/scene/objects/cube* Selects all the cubes in the “objects” folder
//cube* Selects any Leaf node starting with “cube”
/scene//cube1 Select anything called “cube1” inside of “scene”

You are also able to add and subtract and add expressions or paths to one another.

For example:

Expression

What it does

//cube* - /scene/objects/cube1

Selects all the cubes except for “cube1”

//cube* + //sphere* Selects all the cubes and all the spheres
//*telescope* Selects all Leaf prims with telescope in the name
//*telescope*// Selects all prims with telescope in the name plus their descendants
/scene/$lights Selects all prims in the collection called “lights” on the object “scene”

For example, filling in this expression means “selects all the cubes except for “cube1”. Clicking the Select Mask Path button would only select cube2 in the Scene Graph.

Creation and Transform Nodes

GeoCard

Creates a card object in the scene.

GeoCube

Creates a cube object in the scene.

GeoCylinder

Creates a cylinder object in the scene.

GeoPrune

Show/hide or activate/deactivate objects in the scene.

GeoRadialWarp

Warps meshes away from a center point.

GeoTransform

Applies transforms to objects in a 3D scene.

GeoScopePrim

Creates an object used to group other objects together.

GeoSphere

Creates a sphere object in the scene.

GeoXformPrim

Creates and edits Xform prims in your USD stage.