Lops - Assign Material

The Ultimate Houdini node reference

Visit the Node Bible

To learn more, please log in or sign up for free to explore the Node Bible.
Write your awesome label here.

Lops - Assign Material

Write your awesome label here.
This node assigns materials to USD primitives using either direct path, wildcards or vex rules. You can override exciting material assignments and store lookdev variants or changes.

Houdini Docs: https://www.sidefx.com/docs/houdini/nodes/lop/assignmaterial.html
Drag to resize

General 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.

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. (Not Recommended)

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";

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.

VEX Bindings to Export - A pattern that selects VEXpression parameters that should be exported from the final VEX program. I.e., these are the output parameters that will be used for material parameter override.

Materials Parent Path - Specifies the USD path to the parent primitive inside which the LOP should author any automatically created materials with overrides.

Materials Parent Type - Specifies the primitive type of any ancestors that needs to be authored in order to automatically create materials with overrides.

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 attributes 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 - 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/zebra 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.

Include Descendant Primitives in Collection - When Method is “Collection based”, turn on this option to have the collection authored for the collection-based binding be marked to expand all descendants of the target primitives. This will cause the material assignment to be applied to the entire scene graph tree branch. The equivalent of this behavior always occurs when using “Direct” binding, which always inherits down the scene graph tree.

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 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.

Name - Specifies the collection-based material binding name. If empty, the name of the material will be used.

Drag to resize