Deconstructing Reality Composer Pro (Inspector Bindings, References and Variants)

Deconstructing Reality Composer Pro (Inspector Bindings, References and Variants)

The next level of functionality in the RCP inspector offers deeper control over model linking, looks, and variations

Bindings

UI inspector panel showing "Material Bindings" section with two dropdown fields: Binding set to "bunsen_burner_realistic" and Strength set to "Weaker", displaying a USD material path below.

In OpenUSD, the terminology "Binding" comes from the UsdShadeMaterialBindingAPI. Unlike traditional formats where a material is simply a property of a mesh, USD treats materials as independent prims that are bound to geometry prims or their ancestors. This binding creates a relationship that can be inherited down the hierarchy, allowing for powerful overrides.

Texture and Material Resolution

In Deconstructed, bindings are mostly based on texture resolution, which is managed by the Ar: Asset Resolution. When a material property points to a texture, the USDMaterialProperty model stores both the raw asset URL and a resolved path.

  • Resolution: the interop layer resolves asset paths (e.g., @./textures/diffuse.png@) to absolute file system paths.
  • Viewport Integration: For the RealityKit viewport, these bindings are authored directly into the USD Stage's root layer. RealityKit's USD importer (within RealityKitStageView) monitors these authoring changes. When a binding is updated, RealityKit resolves the material and textures and uses the same resolved paths to create RealityKit.Material instances and apply them to the corresponding ModelEntity.

Binding Strength: Weak vs. Strong

The Inspector provides a "Strength" option (using USDMaterialBindingStrength) which corresponds to USD's binding precedence:

  • Weak (weakerThanDescendants): The default. It allows the material to be inherited by all children, unless a child prim has its own direct material binding.
  • Strong (strongerThanDescendants) enforces the material onto the prim and all its descendants, disregarding any direct bindings those children may have. Use this to "paint over" complex hierarchies with a single material (e.g., a "draft" or "ghost" material).
  • Contextual Visibility: This option is visible only when a material is actively bound to the selection. In Deconstructed, the MaterialBindingsSection only shows the strength picker if a resolvedBindingPath exists, as strength is a property of the binding relationship itself, not the Material prim.

References

UI inspector panel shows the "References" section with a 3D cube icon next to a truncated file path, plus Add (+), Remove (-), and Replace controls below.

One outstanding (and sometimes overlooked) feature of the Inspector in RCP is the exposition of References. By using references, a model is treated as a "library object instance."

ℹ️
This is a functional instancing (compositional) rather than a mesh-level instancing (i.e., MeshInstanceComponent).

This means that the entire subgraph of the referenced model is imported while remaining "live."
Deconstructed (and most probably RCP) uses theUsdReferences composition arc to implement reference detection and authoring. When a model is added to a scene, the addPrimReference command is called, which authors the reference into the root layer of the current stage.

Other Benefits

  • Progressive Refinement: the replace Reference feature is specifically useful for the "blocking out" workflow. You can start with a low-poly proxy reference and, as the art progresses, replace it with a high-fidelity model. Because bindings and transforms are often authored on the referencing prim (the "over") as overrides, these edits persist even when the source model reference is swapped.
  • Resource Optimization: Since the referenced layers are shared in the SdfLayer registry, multiple references to the same file don't multiply the memory footprint of the underlying mesh data, only the "over" data in the scene.

When references are edited, the viewport reloads the entire scene (which required some extra logic for preserving camera position), which, while not as smooth as RCP's experience, is needed to ensure visual consistency.

Variants

UI inspector panel showing the "Variants" section with a dropdown menu displaying style options: None, iconic, papercraft (currently selected with orange highlight and checkmark), realistic, and stylized.

USD Variants (UsdVariantSets) are "switchable" versions of a prim. A single prim can have multiple VariantSets (e.g., "Color," "DamageLevel," "LOD"), each containing multiple options.

🖖
Variants are one of the most powerful composition features of USD

Sharing and Optimization

VaVariants are highly efficient because they share all data that has not been explicitly changed in the variant selection.or instance, two variants of a spaceship might share the same vertex data but swap the texture layer or a single sub-component visibility (i.e., the flag). This reduces file size and memory overhead compared to having multiple separate models.

Extraction and Selection in Deconstructed

  • Detection: DeconstructedUSDInterop.listPrimVariantSets to query the USD Stage. It extracts the USDVariantSetDescriptor, which includes all available options, and identifies the currently active one.
  • Selection: The Inspector's PrimVariantsSection dynamically builds a picker for each VariantSet. When a user changes the selection, the app triggers setPrimVariantSelection.
  • Update: To be sure that the RealityKit viewport reflects the change, the selection is authored with persist: true and editTarget: .rootLayer. This forces a stage recomposition notification (similar to a reference update) that allows RealityKit to catch up and re-render the prim with the new variant.

Catalog Configuration (WIP)

Reality Composer Pro (RCP) can use variants to create Configuration Catalogs. In Deconstructed, there is a specialized internal path (represented by the "Convert Variants to Configurations" button in the UI) designed to useUSDInteropAdvanced.combineVariants. This will allow (in the future) the app to flatten or transform USD variants into the specific catalog structures RealityKit expects.

Release 6-inspector-bindings-references-variants · elkraneo/Deconstructed
Inspector bindings/references/variants milestone