Variant Workflows
Overview
USD Variants are a very powerful tool in USD composition that allows prims to have different options on a single asset. This can be done by modifying variations of the same prim parameters per variant option in a set.
Recommended Usage
There are two key things to remember about USD Variants: USD Opinion Order and USD Variant Passthrough.
USD Opinion Order
Variants are the third in USD Composition order. This means that if any parameter that is used in a variant is also used in a USD Layer, then the Variant will appear to not work because there is a layer opinion that is stronger.
Layers → Inherits → Variants → References → Payloads → Specialize (LIVERPS) |
Currently, there are visual indicators in the Variant Editor to assist in identifying opinion strength. A round icon located to the left of all parameters in the Variant editor provides information on where variants and opinions are stored. Future features will continue to be built in ways that enable users to see opinion information.
Note
If a parameter being set by a variant does not appear to be changing when a variant is set, check to make sure there is not a stronger opinion overriding it.
USD Variant Passthrough
All variant sets have a blank option, referred to as the passthrough option, which allows the default values of parameters through. In the case of a variant of variants (also referred to as a variant driving other variant options), the child variants need to be set to passthrough for them to be controlled by the parent.
Note
If variants appear to not be swapping when being set from a parent variant, check to make sure the child variants are set to the blank option to allow passthrough.
Performance Considerations
For the best performance with Variants, it is best to follow a few guidelines:
Author variants as close to the prim you are changing as possible, ideally on the prim being modified by the variant or on its direct parent.
Variants that swap prims using visibility are more performant, but have a greater impact on memory usage.
Variants that swap payloads by asset paths will require less memory, but the stage will take longer to compose after swapping.
Variants that swap shader parameters perform better than variants that change material bindings.