Skip to content

Composition nodes

Tags: composition, layers, variants, export

Build a scene out of other files and layers, choose between variants, and get the result as text or a file.

Node Inputs Output What it does
Add Reference
usd:add_reference
stage
prim_path = "/"
asset_path
target_prim
stage References a USD file on a prim.
Add Payload
usd:add_payload
stage
prim_path = "/"
asset_path
target_prim
stage Adds a payload of a USD file to a prim, a reference that can stay unloaded.
Add Inherit
usd:add_inherit
stage
prim_path = "/"
class_path
stage Makes a prim inherit from a class prim.
Add Sublayer
usd:add_sublayer
stage
layer_path
stage Adds a layer file to the sublayers of the root layer.
Remove Sublayer
usd:remove_sublayer
stage
layer_path
stage Removes a layer from the sublayers of the root layer.
List Sublayers
usd:list_sublayers
stage list Lists the sublayers of the root layer.
Add Variant Set
usd:add_variant_set
stage
prim_path = "/"
set_name
variants = []
stage Adds a variant set with variants to a prim.
Set Variant Selection
usd:set_variant_selection
stage
prim_path = "/"
set_name
variant
stage Selects a variant of a variant set.
Get Variants
usd:get_variants
stage
prim_path = "/"
dict Describes the variant sets of a prim: their variants and selection.
Export To String
usd:export_to_string
stage
flatten = False
string Gets the USD text of a stage, optionally flattened into one layer.
Flatten Stage
usd:flatten_stage
stage
path
string Composes a stage into one layer and writes it to a file.

Notes

  • Add Reference and Add Payload take a file and, optionally, a target_prim in it. Without a target, the default prim of that file is used, so a file without one gives nothing: set its default prim, or give the target. A payload is a reference that can be left unloaded; here it is loaded.
  • Add Inherit points the prim at a class prim, usually named with a leading underscore like /_class_asset. It has no effect until that prim exists.
  • Add Sublayer adds the layer as the weakest of the root layer. Remove Sublayer takes the path as it was added.
  • Add Variant Set adds the set and its variants, and keeps variants it already has. Set Variant Selection with an empty variant clears the selection. Get Variants gives, for every set, its variants and its selection.
  • Export To String gives the USDA text of the root layer. With flatten the whole stage is composed into one layer first, with references, payloads and variants resolved. Flatten Stage writes that to a file.