Houdini 18.0 Nodes LOP nodes

Assign Material

Assigns a material to one or more USD primitives. You can use also programmatically assign materials using VEX, programmatically override material settings for each assignment, and programmatically assign materials to geometry subsets.

On this page

How to

To...Do this

Assign a material to one or more primitives

  1. In the Primitives parameter, specify the primitive(s) you want to assign the material to. You can click the select button beside the text box to choose the primitives from the scene graph tree.

    You can also use primitive patterns for advanced matching. This includes selecting all primitives in a collection, for example all prims in the donuts collection on /table using /table.collections:donuts

    Tip

    If you assign a material to all prims in a collection, you probably also want to set the Method (under "Material Binding") to "Collection based", so the node assigns the material to the collection itself, rather than individually to each prim currently in the collection.

  2. Set Specify material using to "Explicit path".

  3. Set Material path to the path of the USD material you want to assign. You can click the select button beside the text box to choose the material from the scene graph tree.

Assign computed materials using VEX (advanced)

  1. In the Primitives parameter, specify the primitive(s) you want to assign the material to. You can click the select button beside the text box to choose the primitives from the scene graph tree. You can also use primitive patterns for advanced matching.

  2. Set Specify material using to "VEXpression".

  3. In the VEXpression box, enter a VEX snippet to compute the material to assign to each primitive.

    The snippet is run once for each selected primitive. The path of the current primitive is available as @primpath. The index of the current primitive is available as @elemnum, the total number of selected primitives is available as @numelem.

    Under "CVEX Bindings", when Autobind by name is on (the default), each attribute on the current primitive is available as a VEX variable of the same name. This allows you to assign different materials based on a primitive’s attribute values. (If you don’t want to or can’t use autobinding, you can manually set up individual mappings between parameter names and VEX variable names using the multiparm under "CVEX Bindings".)

    The snippet must return a string containing the material path to assign to the current primitive.

    For example, this snippet alternates between assigning rough_red and rough_blue based on whether a primitive is at an odd or even position in the list of selected primitives:

    return (@elemnum % 2) ? "/materials/rough_red" : "/materials/rough_blue";
    

Override material parameters using VEX (advanced)

This lets you compute different values for material parameters for each assignment.

  1. Set Parameter override to "VEXpression".

  2. In the Override VEXpression box, enter a VEX snippet to override parameters on the assigned material.

    The snippet is run once for each selected primitive. The path of the current primitive is available as @primpath. The index of the current primitive is available as @elemnum, the total number of selected primitives is available as @numelem.

    Under "CVEX Bindings", when Autobind by name is on (the default), each parameter on the material is available as a VEX variable of the same name. For example, if the material has a parameter named roughness, you can override it by setting the corresponding variable in the VEX snippet:

    @roughness = (@elemnum % 3) ? 0.25 : 0.5;
    

    If you don’t want to or can’t use autobinding, you can manually set up individual mappings between parameter names and VEX variable names using the multiparm under "CVEX Bindings".

Assign materials to individual elements in geometry using VEX (advanced)

  1. Set the Primitives to the path of the geometry primitive (for example, a Mesh prim).

  2. Set Specify material using to "VEXpression".

  3. Under "Material Binding", turn on Create and bind geometry subsets.

  4. In the VEX snippet, @elemnum contains the index of the current element in the selected geometry (for example, polygon face), and @numelem contains the total number of elements in the geometry.

    The snippet must return a string containing the material path to assign to the current element.

The node will automatically create geometry subsets for each set of elements with the same material path.

Using CVEX VOP networks (not recommended)

Note

We strongly encourage you to use VEXpressions instead of CVEX VOP networks. As detailed below, CVEX networks require multiple steps to set up. Unless you need a very elaborate VOP network to do the computation, or want to re-use some existing VOPs, writing a VEX snippet is much easier.

  1. Set either Specify material using or Parameters override to "CVEX".

  2. The most convenient place to create the CVEX VOP network is inside the Assign Material node itself (it contains a VEX Builder network). Dive inside, press ⇥ Tab and create a CVEX Shader Builder network node.

  3. Rename the CVEX Builder with a memorable name based on what the network will do (for example, material_assignment). If you are doing multiple assignments in the Assign Material node, using multiple CVEX networks, they must each have unique names.

  4. Dive inside the CVEX Builder node and put down a USD Global Parameters node. This provides the basic inputs (primpath, elemnum, and numelem).

  5. If the Assign Material node is creating bindings, you can add corresponding Parameter VOPs in this network to represent the bound VEX variables.

    If you are assigning to parameters to override material attributes, remember to set the Parameter VOP’s Export parameter to "Always" or "When input is connected".

  6. If you are using the network to compute material assignments, create a single Parameter VOP at the end of the network to represent the "return" value. Set its Name to matname, set its Export parameter to "Always", and connect the rest of the network to its input.

  7. Fill in the VOP network to do the computation you want.

  8. Go back up to the Assign Material node’s parameters. In the CVEX node or Override CVEX node parameter, enter the path to the CVEX network you just created.

    If you created the network inside this Assign Material node, you can simply enter the network’s name, for example material_assignment.

    If you created the network elsewhere, you must enter a path to the network node, for example /mat/material_assignment.

Tips

  • In VEX snippets, you can use @ variable names containing colons (:). This makes it easier to automatically bind certain USD attribute names (for example i@primvars:foo). (These names are not normally legal in names in VEX source code. The node automatically encodes these kinds of names when used in a snippet.)

Parameters

Number of materials

You can perform multiple assignments within one node. Set this to the number of assignments you want to perform, or use the plus and minus button to add or remove assignments.

Primitives

The primitive(s) you want to assign the material to. You can click the select button beside the text box to select the primitives from the scene graph tree. You can also use primitive patterns for advanced matching.

Specify Material Using

How to specify the material to assign.

Explicit path

Assign a material at a certain path in the scene graph tree.

VEXpression

Assign a material to each selected primitive based on the results of computing a VEX snippet.

CVEX Script

TBD.

Material Path

When Specify material using is "Explicit path", the USD path to the material primitive to use for binding.

VEXpression

When Specify material using is "VEXpression", this VEX snippet is computed for each selected primitive. You can use @primpath (the path of the current primitive), @elemnum (the index of the current prim in the list of selected prims), and @numelem (the total number of selected prims). Must return a string containing a path to the material to assign to the current prim.

For example, this snippet alternates between assigning rough_red and rough_blue based on whether a primitive is at an odd or even position in the list of selected primitives:

return (@elemnum % 2) ? "/materials/rough_red" : "/materials/rough_blue";

CVEX Node

When Specify material using is "CVEX", the path to a CVEX VOP network. See CVEX VOP networks above.

Parameters Override

Whether and how to override individual material parameters for each assignment.

None

Do not override material parameters.

VEXpression

Run a VEX snippet for each assignment that can compute new parameter values.

CVEX

TBD.

Override VEXpression

When Parameter override is "VEXpression", this VEX snippet is run for each selected primitive. The settings under "CVEX Bindings" control how material parameters are mapped to VEX variables. You override a material parameter by assigning to the corresponding variable. You can also use @primpath (the path of the current primitive), @elemnum (the index of the current prim in the list of selected prims), and @numelem (the total number of selected prims).

For example, if the material has a parameter named roughness (and Autobind by name is on, the default), you can override it by setting the corresponding variable in the VEX snippet:

@roughness = (@elemnum % 3) ? 0.25 : 0.5;

Override CVEX node

When Parameters override is "CVEX", the path to a CVEX VOP network. See CVEX VOP networks above.

CVEX Bindings

Autobind by Name

When this is on, attributes on the current primitive (when computing assignment) or on the material (when computing overrides) are automatically made available as VEX variables with the same name in the relevant VEXpression (or CVEX network). You can turn this off and map attribute names to VEX variable names manually using the multiparm below.

Number of Bindings

The number of manual attribute to VEX variable bindings to create.

Attribute Name

In a binding pair, the name of the USD attribute to convert to a VEX variable.

VEX Parameter

In a binding pair, the name of the VEX variable to create to mirror the USD attribute.

Material binding

Create and Bind Geometry Subsets

When this is on, the Primitives parameter should point to a geometry or geometry subset primitive, and the node runs the VEX snippet for each geometry element (for example, polygon face) in the geometry, instead of for each selected primitive. In the snippet, @elemnum is the index of the current element, and @numelem is the total number of elements in the geometry.

The node will automatically create geometry subsets for each set of elements with the same material path.

Purpose

Sets the purpose value for the assignments. This controls what types of renders the assignment applies to.

All

The assignments apply to all rendering.

Full Render

The assignments only apply in full/final renders.

Preview Render

The assignments only apply in preview renders.

Strength

Controls the strength of the assignment "opinion" relative to any conflicting assignments on descendant prims under the assigned primitives in the tree. (For example, if this node assigns /materials/zerbra to /a, but /a/b/c already is assigned /materials/tiger).

Default

Use normal rules for opinion strengths (assignments on descendants override assignments on ancestors).

Stronger than descendants

This assignment always overrides assignments on primitives lower in the tree.

This is useful if you want collection-based binding to override child primitives that already have a material binding. This option ensures the collection-based binding on the ancestor takes effect despite the general rule that descendant opinions are stronger than ancestors.

Weaker than descendants

This assignment is always overridden by assignments on primitives lower in the tree. This is the same as "Default".

Method

How to express the material assignment in USD.

Direct

Assign the material by authoring a material:binding relationship on each individual primitive.

Collection based

Assign each material to a collection of primitives on a common ancestor using the material:binding:collection relationship. If you specified the primitives using a collection in the Primitives parameter, this will re-use that collection. Otherwise, you can specify the path to the a prim using the Path parameter below and the node will create a new collection on that prim.

Note, the USD specification for the collection-based material binding says that the material is assigned only to primitives that are descendants of the primitive on which the binding relationship is defined (see Path parameter). That is, the binding does not affect any primitives in the collection that are not descendants of that primitive.

Path

When Method is "Collection based", the collection-based binding will be defined on a primitive at this path.

Also, if this LOP node needs to create a new collection, it will create it on a this primitive as well.

If the path is empty, the LOP node tries to use the deepest ancestor common to all primitives given in the Primitives parameter.

LOP nodes

  • Add Variant

    Adds one or more variants to a variant set on a primitive. This node creates the primitive if it doesn’t exist.

  • Additional Render Vars

    Create multiple render vars.

  • Assign Material

    Assigns a material to one or more USD primitives. You can use also programmatically assign materials using VEX, programmatically override material settings for each assignment, and programmatically assign materials to geometry subsets.

  • Attribute Wrangle

    Create/edit USD primitive attributes using a VEX snippet.

  • Auto Select LOD

    Automatically selects a level-of-detail variant based on the primitive’s distance from the camera.

  • Bake Skinning

    "Bakes" animation driven by a UsdSkel into transforms and point positions.

  • Begin Context Options Block

    This node begins a block of LOP nodes, within which certain context options have certain values.

  • Blend

    Partially applies edits to a layer’s attributes based on a fractional weight.

  • Cache

    Caches the results of cooking the network at different times, increasing playback speed.

  • Camera

    Adds a USD camera to the scene.

  • Capsule

    Creates or edits a "capsule" (tube with hemispherical ends) shape primitive.

  • Collection

    Creates/edits a collection using selected prims.

  • Cone

    Creates or edits a cone shape primitive.

  • Configure Layer

    Edits metadata on a layer.

  • Configure Primitives

    Edits various metadata on one or more primitives.

  • Configure Properties

    Configures metadata on properties (relationships and attributes).

  • Configure Stage

    Configures metadata for how to load layers into the stage and asset resolution.

  • Create LOD

    Uses the PolyReduce SOP to automatically generate multiple levels of detail from a high-res model, and stores them as USD variants.

  • Cube

    Creates or edits a cube shape primitive.

  • Cylinder

    Creates or edits a cylinder shape primitive.

  • Dome Light

    Creates or edits a USD Dome Light prim. A dome light emits light inward, simulating light coming from the sky/environment surrounding the scene.

  • Drop

    Runs a simulation to drop primitives under gravity.

  • Duplicate

    Creates copies of a prim (and its descendants).

  • Edit

    Interactively transforms prims in the viewer. Can use physics collisions to position props realistically.

  • Edit Context Options

  • Edit Material

    Allows you to edit an existing USD material by modifying parameters and shader connections. This can be useful if the existing material is on a non-editable layer.

  • Edit Properties

    Lets you build a spare parameter interface to directly edit attribute and relationship values.

  • Edit Prototype

    Switch point instances or USD instanceable prims to instance a different prototype.

  • Edit Target Layer

    Allows you to apply edits directly in a lower layer, instead of overriding prims and attributes in the active layer.

  • Error

    Generates a message, warning, or error, which can show up on a parent asset.

  • Extract Instances

    Converts an instance into a "real" editable prim.

  • Fetch

    Grabs the output of another LOP, potentially in another LOP network.

  • Follow Path Constraint

    Constrains a prim to follow a path curve.

  • For Each

    The end node of a For-Each loop block.

  • Geometry Subset VOP

    Creates USD geometry subsets within geometry prims (similar to groups in SOPs) based on evaluating a VEXpression or VOP network.

  • Graft

    Takes scene graph trees from other inputs and attaches them onto branches of the scene graph tree in the first input.

  • Inline USD

    Parses usda code representing a layer and adds it to the layer stack.

  • Instancer

    Instances or copies primitives onto points.

  • Karma Procedural

    Sets up render-time instantiation for Karma.

  • Karma Render Properties

    Configure Render Properties for Karma (Beta).

  • Karma Standard Render Vars

    Create standard karma render vars (AOVs/Image Planes).

  • LOP nodes

    LOP nodes generate USD describing characters, props, lighting, and rendering.

  • Layer Break

    Starts a new active sublayer that subsequent nodes will edit.

  • Layer Replace

    Replaces all uses of a certain layer with a substitute layer from its second input.

  • Light

    Creates or edits a USD Light prim. This node also adds some useful Karma-specific attributes.

  • Light Linker

    Creates USD light link properties based on rules.

  • Light Mixer

    Lets you interactively edit USD properties for multiple lights.

  • Load Layer

  • Look At Constraint

    Constrains a prim to always point toward a target.

  • Material Library

    Imports Material VOP nodes as USD material prims.

  • Material Linker

    Creates material assignments based on rules.

  • Material Variation

    Creates attributes/primvars to override material parameters per-prim/instance.

  • Merge LOP

    Merges the layers from incoming stages into a unified layer stack.

  • Modify Point Instances

    Modify point transforms and property values for individual point instances.

  • Null

    This node does nothing. It can be useful to insert a Null into a network as a "fixed point" in the network that you can refer to by name in expressions/scripts.

  • Output

    Represents the output of a subnetwork. Allows you to design a node asset with multiple outputs.

  • Parent Constraint

    Makes a primitive appear to inherit the transform hierarchy of another prim somewhere else in the tree.

  • Points Constraint

    Position and Orient primitives using point positions from a geometry.

  • Primitive

    Bulk-creates one or more attributes of a certain type.

  • Prune

    Hides or deactivates primitives and point instances.

  • Python Script

    Lets you write Python code in the node to use the USD API to directly manipulate the stage.

  • Reference

    References the contents of an external USD file into a branch of the existing scene graph tree, or removes/replaces existing references.

  • Render Geometry Settings

    Applies renderer-specific geometry settings to geometry in the scene graph.

  • Render Product

    Creates or edits a UsdRenderProduct prim, which represents an output of a renderer (such as a rendered image file or other file-like artifact produced by a renderer), with attributes configuring how to generate the product.

  • Render Settings

    Creates or edits a UsdRenderSettings prim, which holds the general settings for rendering the scene.

  • Render Var

    Specifies a custom variable computed by the renderer and/or shaders, either a shader output or a light path expression (LPE).

  • Retime Instances

    Offsets and/or scales the timing of animation on selected instances.

  • SOP Create

    Lets you create geometry in a SOP subnetwork inside this node, so you can create geometry in-place in the LOP network instead of needing a separate SOP network.

  • SOP Import

    Imports geometry from a SOP network into the USD scene graph.

  • SOP Modify

    Converts USD geometry into SOP geometry, runs the SOP subnet inside this node on the geometry, and converts the changes back to USD overrides.

  • Scene Import

    Imports models, materials, and lights from the Object level into the LOP network.

  • Scope

    Creates a "scope" primitive. Scope is the simplest form of grouping, and does not have a transform. Scopes can be useful for organizing the scene tree.

  • Set Extents

    Sets the bounding box metadata of selected primitives.

  • Set Variant

    Selects (switches to) one of the variants stored in a variant set on a primitive.

  • Simulation Proxy

    Generates low-poly collison geometry suitable for physical simulation and creates a proxy relationship to the original model.

  • Sphere

    Creates or edits a sphere shape primitive.

  • Stage Manager

    Provides a convenient interface to reference in many files at once and place them in the scene graph tree.

  • Store Parameter Values

    Lets you store temporary (unsaved) data in the stage.

  • Sublayer

    Imports from USD files or other LOP node chains into as sublayers, or removes/replaces/reorders existing sublayers.

  • Subnet

    Encapsulates a LOP subnetwork, allowing you to organize and hide parts of the network.

  • Surface Constraint

    Constrain a prim to stick to a surface.

  • Switch

    Passes through one of several inputs, based on a parameter choice or expression.

  • TimeShift

    Outputs the stage as it is at a different point in the timeline.

  • Transform

    Edits the transforms of selected USD primitives.

  • Transform UV

    Moves, rotates, and scales texture coordinates on USD primitives.

  • USD ROP

  • USD Render ROP

  • Value Clip

  • Vary Material Assignment

    Assign different materials across a number of prims to create variation.

  • Volume

    References volume data on disk into a volume prim containing field prims.

  • Xform

    Creates or edits an Xform prim. Xform (and its sub-classes) represents a transform in the scene tree.

  • attribvop