Material Variation

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.

Material Variation

Write your awesome label here.
Creates attributes/primvars to override material parameters per-prim/instance.

Houdini Docs: https://www.sidefx.com/docs/houdini/nodes/lop/materialvariation.html

This node lets you change the value of a material parameter (for example, base color) individually for each prim or point instance that has that material assigned. This node makes it easier to author material override primvars, and lets you compute the override values using expressions and/or VEX.

Visual Example of a Setup:

Drag to resize

Syntax for Instancers:

Drag to resize

Parameters:

Type - Whether you want to create overrides for prims (including instanceable prims) or point instances.

Primitives - The primitive(s) the node should operate on. You can drag primitives from the scene graph tree pane into this textbox to add their paths. You can also use primitive patterns for advanced matching, including matching all prims in a collection (using /path/to/prim.collection:‹name›).

Instances - A space-separated list of instances, using /‹path›[‹instance_index›] syntax (for example, /geometry/instancer[0] /geometry/instancer[1]). To select all instances in an instancer, use /‹path›[*]. To select a range, use /geometry/instancer[4-7] (the range is inclusive). To select instances inside nested instancers, use multiple indexes, for example /geometry/instancer[2][7]. VEXpressions can be used to specify instances, for example, /geometry/instancer[{@weights>0.5}].

Primvars - You can override multiple material parameters in one node. Set this to the number of overrides you want to create/edit, or click the plus and minus buttons to add or remove overrides.

Enable - For each override, whether to actually author the primvar.

Name - The name of the primvar to create or edit. Do not include the primvars: prefix. You can choose the name of a material parameter from the drop-down menu next to this field.

Type - The USD data type for the primvar, This should match the type of the material parameter. (If you choose the Name from the drop-down menu, it sets this automatically.)

Source: 

    --  Internal SOP - Use the SOP subnet inside this node to process points representing the prims/instances.

    --  External SOP - Use an external SOP network that must generate points representing the prims/instances from scratch.

    --  Uniform - Use the parameters (which can be driven by expressions).

Interpolation - When Source is set to “Uniform” and Use Snippet is enabled, the primvar interpolation authored on mesh primitives will be set to the following value and the primvar will be authored as an array attribute of the corresponding length. The interpolation of the primvar authored on instances or primitives other than meshes will always be set to “constant”.

Scalar Values - When authoring primvars on primitives or native instances with a constant interpolation, this enables the primvar to be authored as a single scale value rather than an array of length 1.

Use Snippet - When Source is “Uniform”, get the value for each primitive/instance by evaluating a VEX snippet. The snippet should write the override value to the value variable. index is the index of the current primitive/instance. You can use @Frame and @Time to make the value time-dependent.

Value - When Source is “Uniform”, the value to use for this primvar. (This can be driven by expressions.)