Houdini 20.5 Nodes 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.

On this page
Since 17.0

Overview

USD allows storing multiple named variants of a primitive on the primitive. Each variant can have different attributes, relationships, and children. You can switch the primitive between different variants in different layers. Each primitive can store multiple groups of variants in named variant sets.

The following are some common use cases for variants:

  • A family of different geometry (for example, a primitive that can switch between different types of trees).

  • Levels of detail (storing progressively lower resolution versions of the same geometry as variants, and switching based on distance to the camera).

    Houdini includes the Create LOD and Auto Select LOD nodes for automating this workflow.

  • Material assignments (storing variants with different materials assigned to them to allow switching the look of the primitive easily).

Here is an example of a layer which contains a variant set called owner, where each variant’s color corresponds to which character in the story owns that ball:

#usda 1.0
()

def Sphere "toyBall" (
    variants = {
        string owner = "blake"
    }
    append variantSets = "owner"
)
{
    double radius = 1
    variantSet "owner" = {
        "andy" (
        ) {
            color3f[] primvars:displayColor = [(1, 0, 0)] (
                interpolation = "constant"
            )


        }
        "blake" (
        ) {
            color3f[] primvars:displayColor = [(0, 0, 1)] (
                interpolation = "constant"
            )


        }
        "sally" (
        ) {
            color3f[] primvars:displayColor = [(0, 1, 0)] (
                interpolation = "constant"
            )


        }
    }
}

See Variant Set in Pixar USD glossary

How to

  1. Connect the “main” stage line to the node’s first input.

  2. Set the Primitive path to the path of the primitive you want to add the variant to, and the name of the Variant set to add the variant to on the primitive.

    This node will create a primitive at the given path(s) and any parent prims if they don’t exist. The Primitive kind and Parent primitive type parameters control what type of primitives to create in this case.

    Optionally, you can supply an explicit list of space separated primitive paths to Primitive path, or a prim pattern pointing to existing prims on the stage, to add the variant to multiple primitives.

  3. Connect a stage containing the variant primitive you want to add to the second multi-input.

    Often, this “variant” input will not be a “full” stage, but just the result of importing geometry from a SOP network or from disk into USD.

    If the primitive branch you want to use as a variant already exists on the “main” stage, you can connect the “main” stage line to both the first and second inputs.

  4. Set the Variant path to the path to the primitive that defines the variant you will add. (This path is in the scene graph tree of the second input.)

  5. In the table at the bottom of the parameter editor, double-click the right column next to the input node to and enter the name for this variant in the variant set.

    (If you don’t specify a name, one is computed automatically using the expression in the Variant name default parameter.)

    The variant copied from the second input into the variant set includes the primitive you point to in Variant path and all its descendants.

Note

You can repeat the last three steps to add more variants to the given variant set. This only works if the Variant path is the same in each variant input.

Tips

  • The node sets the context option VARIANT to the name of the variant being defined as it cooks each input. This allows the input nodes to respond to the variant name set on this node, or to have the same input node connected to this node multiple times, and produce unique output for each variant name.

    The node also sets the context option VARIANTINPUT to the input number of each variant as each is cooked. This allows per-variant responses which don’t depend on the variant name directly.

    The node also sets the context option VARIANTPRIM to the primpath of the prim to which the variant is currently being added. This allows per-variant responses to the primpath the variant is being added to when adding the variant to multiple prims at once.

    These context options are also available to the parameters of the Add Variant node, allowing the selection of Variant Source Primitive or Source Primitive based on variant name or the primpath the variant is being added to, etc.

  • The layers of the stage connected to the second input are always “flattened” into a single layer to allow copying all the information defining the variant into the active layer.

  • The contents of the flattened layer are completely unchanged by the copy operation, so defined primitives will be defined inside the variant, and over primitives will be over primitives inside the variant.

  • USD imposes no restrictions on the contents of variants. If further opinions are going to be expressed on the primitive specified in Primitive path or its children, you may want to provide a consistent structure to the data of each variant (so the later opinions “fit” correctly no matter which variant is currently selected), but that is completely optional.

  • If you want to use variants for level of detail, check out the Create LOD and Auto Select LOD nodes.

  • If you are using variants to switch between different material assignments, the content of each variant should be very similar. When authoring these material assignment overrides, you will want to be able to see the effect of these assignments in context before using them to create the variants.

    Typically, this means all the variants will be branches off the same input LOP node, likely the same LOP node connected to the first input of this Add Variant node.

    Use a Layer Break node before each set of material assignments to strip out all information above the Layer Break during flattening, resulting in each variant input copying only the material assignment overrides to the variant definition.

  • If the given name in the given variant set on the given primitive already exists, the node copies the primitives from the variant input without any attention to the existing variant. If the existing variant was defined in the active layer, some or all of the existing primitives may be overwritten. If the existing variant was in a layer other than the active layer, the information from the new variant will be composed as a stronger layer over the existing primitives.

  • If you don’t add any variants using the second multi-input, this node passes through the stage from the first input unchanged.

  • To select a variant on a USD primitive, use the Set Variant LOP.

  • Opinions expressed in variants are weaker than opinions expressed in the local layer stack. This strength ordering can make it appear that the variant is having no effect on the primitive. The option to Warn of weak variant opinions will add a warning to this node if this situation is detected. In this case, the simplest solution is to enable the use of a separate Source primitive. Set the Source primitive to the current value of the Primitive path, and set the Primitive path to a new path where the variants will be created, using a reference to the Source primitive. Opinions expressed in variants are stronger than opinions expressed in references, so the opinions in the variant will be composed onto the stage as expected.

    If you want to reference a Source primitive onto multiple Primitive paths at once, then you must supply a space separated list of explicit primitive paths that do not currently exist on the stage. A primitive pattern will not work in this case, since it would only find existing primitives.

    Additionally, you can make use of the VARIANTPATH context option to vary the Source primitive per primitive when specifying multiple Primitive paths.

Inputs

First input

The stage containing the primitive to store the variant on. This stage is passed through to the output with any changes made by this node.

Second input (multi-input)

Each input you connect represents a stage containing a primitive you want to add as a variant on a primitive in the first input. Note that adding multiple variants at once only works if all the variants are at the same Variant path in their respective scene graph trees.

Parameters

Primitive path

The path to the primitive to which the new variant information will be added.

Optionally, you can specify a space separated list of explicit primpaths or a prim pattern to add the variant to.

Source primitive

The path to the primitive that is the base definition on which the variants will be authored. This primitive will be referenced into the new primitive(s) at the primitive path(s) where the variant will be defined. This indirection ensures that opinions in the variant will be stronger than opinions that already exist on the source primitive.

Warn of weak variant opinions

Adds a warning if any variant opinions are weaker than existing opinions. As each variant is added, this option examines the composed stage with that variant selected. If any opinions added by the variant are not the strongest opinion on the composed stage, add a warning. Turn off this option to avoid the performance penalty of checking for this condition.

Primitive kind

If no primitive exists at the specified Primitive Path, and this node must create a new Xform primitive at the specified location, this parameter controls the Kind that will be authored on this new primitive.

Parent primitive type

If no primitive exists at the specified Primitive Path, and this node creates a new primitive at that location, this parameter controls the primitive type of any ancestor primitives that may have to be created prior to creating the final primitive.

Create options block

You usually don’t need to set or change this parameter yourself. This parameter is set to on when this node is part of a “variant block” (when created by the “Add variants to existing primitive” tool), or off when this node is stand-alone (created by the “Add variants to new primitive” tool).

(As this node cooks each node connected to its multi-input, it sets a context option containing the name of the current variant being created. When this is off, the context option is available to all nodes in the input chain. When this is on, the context option is pushed on the stack, and the Begin Context Options Block LOP at the start of the block will pop it off the stack, hiding it from nodes further up the chain.)

Variant set

The name of the variant set to which this node should add its variants.

Variant set strength

If the variant set is new, indicates the strength of this variant set relative to other variant sets on this primitive. Like references, variant sets are applied in a well defined order so that overlapping opinions in a stronger variant set will always take precedence over opinions in weaker variant sets.

Variant source primitive

The path to the root of the primitives that should be copied from each variant input’s scene graph into the variant.

Variant name default

Each variant input allows you to control the name of the variant that it will create within the variant set. This variant name is set in the second column of the interface displaying the list of connected inputs. The Variant Name Default parameter controls the variant name that is used if no name is explicitly set in that second column of the connected inputs interface.

In the expression you can use the @input local variable ($IIDX is deprecated) as the index of the current input (numbered from left to right starting at 1 for the multi-inputs).

Set variant selection

When this is on, this node also selects (switches the primitive to) the last variant added. When this is off, this node does not affect the currently selected variant.

(You can also use the Set Variant LOP to select a variant.)

See also

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.

  • Asset Reference

    Reference, Transform, and select variants of a USD Asset.

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

  • Assign Prototypes

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

  • Attribute VOP

    Create/edit USD attribute values using a VOP network.

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

  • Background Plate

    Sets up hold-out or matte objects that leave holes in the scene through which the background is visible. These prims still take shadows and contribute to reflections as if they were the background.

  • Bake Skinning

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

  • Basis Curves

    Creates or edits a basis curves shape primitive.

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

  • Blend Constraint

    Blends transforms according to a list of weights specified as parameters.

  • 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 collections using primitive patterns.

  • Component Geometry

    Geometry container or import source, in a network created by the Component Builder tool.

  • Component Geometry Variants

    Sets up geometry variants, in a network created by the Component Builder tool.

  • Component Material

    Assigns materials to geometry in a network created by the Component Builder tool.

  • Component Output

    Assembles the final Component prim, in a network created by the Component Builder tool.

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

  • Coordinate System

    Define named coordinate systems used in shaders.

  • Copy Property

    Copy properties from one primitive to another, or renames properties on a primitive.

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

  • Distant Light

    Creates or edits a USD Distant Light, representing a far-off light source such as the sun. Adds some useful Karma-specific attributes.

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

  • Draw Mode

    Sets draw mode properties on USD model assets.

  • 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 Material Properties

    Lets you build a spare parameter interface that reflects material or shader input attributes to directly edit their values.

  • Edit Properties

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

  • Edit Properties From Node

    Lets you refer to the parameter on another node to directly edit attribute and relationship values.

  • Edit Prototypes

    Modify the prototypes of native or point instances in-place, without disturbing the instancing setup.

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

  • Explore Variants

    Visualize, set, or extract variants on primitives.

  • Extract Instances

    Converts (heroes) an instance into a real editable prim.

  • Fetch

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

  • File Cache

    Caches (writes out once and then reads from) USD layers (possibly animated) to disk.

  • Follow Path Constraint

    Constrains a prim to follow a path curve.

  • For Each

    The end node of a For-Each loop block.

  • Geometry Clip Sequence

  • Geometry Color

    Adds display color and display opacity primvars to geometry.

  • Geometry Sequence

    Imports a sequence of geometry files into LOPs as animated geometry.

  • Geometry Subset VOP

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

  • Graft Branches

    Takes prims/branches from the second input and attaches them onto branches of the scene graph tree in the first input.

  • Graft Stages

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

  • HDA Dynamic Payload

    Cooks a OBJ or SOP asset on disk and imports the animated geometry output as a USD payload.

  • Hermite Curves

    Creates or edits a hermite curves shape primitive.

  • Houdini Feather Procedural

    Generates feathers for rendering.

  • Houdini Preview Procedurals

    Invokes Houdini Procedurals while working interactively.

  • Houdini Procedural: Crowd

    Houdini Crowd Procedural for Solaris.

  • Houdini Procedural: Hair

    Houdini Hair Procedural for Solaris.

  • Houdini Procedural: Ocean

    Houdini Ocean Procedural for Solaris.

  • Houdini Procedural: RBD

    Houdini RBD Procedural for Solaris.

  • Inline USD

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

  • Insertion Point

    Represents a point in the node graph where nodes can be inserted.

  • Instancer

    Instances or copies primitives onto points.

  • Isolate Scene

    Work in masked areas of the stage.

  • Karma

    Renders the USD scene using Houdini’s Karma renderer.

  • Karma Cryptomatte

    Setup Cryptomatte AOVs for Karma.

  • Karma Fog Box

    Creates a constant volume within a box.

  • Karma Physical Sky

    Creates a Karma Sky Dome and Sun Light rig.

  • Karma Render Products

    Create multiple render products sharing common settings.

  • Karma Render Properties

    Configure Render Properties for Karma.

  • Karma Sky Atmosphere

    Creates or edits a Karma Sky Atmosphere.

  • Karma Sky Dome Light

    Creates or edits a Karma Sky Dome Light.

  • Karma Standard Render Vars

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

  • LPE Tag

    Manage Lights' LPE Tags.

  • Labs Karma AOVs for RenderMan Denoiser

    Generates AOVs for the Pixar RenderMan denoiser.

  • Layer Break

    Starts a new active sublayer that subsequent nodes will edit, and indicates all previous layers will be discarded when saving to disk.

  • Layer Replace

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

  • Layout

    Provides tools for populating a scene with instanced USD assets. You can place individual components, paint/scatter components in different ways using customizable brushes, and edit existing instances.

  • Light

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

  • Light Filter Library

    Authors USD light filter primitives from VOP nodes.

  • Light Linker

    Creates USD light link properties based on rules.

  • Light Mixer

    Lets you interactively edit USD properties for multiple lights.

  • Load Layer for Editing

  • Loft Payload Info

    Adds basic information from inside a payload to the primitive that loads the payload.

  • Look At Constraint

    Constrains a prim to always point toward a target.

  • Mask from Bounds

    Sets a primvar based on whether/by how much selected prims are inside a bounding shape.

  • Match Size

    Resizes and recenters the input geometry to match a reference bounding box.

  • Material Library

    Authors USD material primitives from shader VOP nodes.

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

  • Merge Point Instancers

    Merges point instancers into a single consolidated point instancer.

  • Mesh

    Creates or edits a mesh shape primitive.

  • Modify Paths

    Modify asset path attribute values.

  • Modify Point Instances

    Modifies point transforms and property values for individual point instances.

  • Motion Blur

    Adds time samples to allow motion blur when rendering.

  • 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

    Creates or edits a Points shape primitive.

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

  • RBD Destruction

    An example for a fracturing simulation in USD, also useful as a canned effect.

  • Reference

    References the contents of a external USD files and/or layers created by other LOP nodes into a branch of the existing scene graph tree. Can also remove or replace 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).

  • Resample Transforms

    Generates interpolated transform time samples from existing time samples on USD prims.

  • Restructure Scene Graph

    This node has various operations for editing prim paths, variant sets, and composition arcs.

  • Retime Instances

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

  • SOP Character Import

    Imports a character or animation from a SOP network into the USD scene graph.

  • 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 Crowd Import

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

  • 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 Doctor

    Validates primitives on a USD stage.

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

  • Split Point Instancers

    Splits a point instancer into two or more instances, which divide up the original instances.

  • Split Primitive

    Splits USD geometry prims into child primitives based on geometry subsets or primvar values.

  • Split Scene

    This node splits a scene graph into two disjoint sets of primitives.

  • 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

  • Unassign Material

    Unbinds a material from one or more USD primitives.

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