What Is Asset Parameterization?#

Asset_01#

Asset parameterization enables the reuse of content by allowing certain fields and properties to vary downstream.
There are two primary ways to parameterize assets: variant sets and primvars.
Variant Sets#
1def Xform "RaceCar" (variantSets = ["color_variant"])
2{
3 variantSet "colorVariant" = {
4 "red" { ... }
5 "blue" { ... }
6 "green" { ... }
7 }
8}
The entry point is the first place a user goes to determine if prims have discrete variants. Asset structures may enforce naming conventions and require the presence of specific variants. For example, it might be expected that assets provide a color_variant
to describe supported albedo variations.
Primvars#
1def Xform "RaceCar" {
2 color3f primvars:asset_base_color (
3 doc = "primary paint color"
4 )
5 color3f primvars:asset_accent_color (
6 doc = "color of accent stripe"
7 )
8}
Some variations cannot be effectively or efficiently discretized into variants. For these cases, primvars can be used as another form of asset parameterization. Primvars are extra parameters that can be interpolated and are primarily used to provide additional data to shading contexts. In OpenUSD, primvars are inherited down the prim hierarchy and can be authored on an ancestor prim, including the entry point of an asset.
Take, for example, the snippet above. Materials can be constructed to read primvars:asset_base_color
or other entry point primvars. If multiple prims in a hierarchy author the same primvar, remember that child opinions are stronger than parents. We use asset_
as a prefix to avoid namespace collisions.
Unless explicitly documented or annotated as internal, variants and primvars authored on an asset entry point should generally be considered “public” and safe for downstream contexts to edit and set, with an expectation of stability.
Both variant selection and primvars on the asset entry point are compatible with scene graph instancing. Variations in variant selections will generate new prototypes for downstream contexts, while primvars will not.
This generally makes parameterization through primvars the lighter choice for single property parameters, offering upfront memory savings at the cost of additional lookups in materials.
As part of the asset prim interface, collections and relationships can be used to indicate the membership and roles of certain prims. Consider a workflow centered around practical lights. By highlighting these practical lights in a collection at the asset entry point, it becomes easier for users to find and interact with them downstream. For example, they might want to control the intensity or turn the lights on and off.