Deconstructing Reality Composer Pro (Inspector Basics)

Dual-mode Inspector: scene layer shows global stage metadata (upAxis, metersPerUnit), while prim inspection displays transform, materials, and references. UI presents cm/degrees; USD persists meters/quaternions with rotationEulerHint for round-trip editing.

Deconstructing Reality Composer Pro (Inspector Basics)

The Inspector in RCP focuses on context-sensitive information, precise input, and the management of components (as in ECS). For the first, we need a stable element selection system; for the second, we need a dynamic display of properties with the entire state flowing; and for the third, we will need to dig into USD Schemas...

All this functionality will require some iterations to get feature parity. So to get started, we will focus on basic context selection and default property inspection.

💭
I am looking forward to implementing the Add Component functionality, for example, but now is not the right time...

The Deconstructed inspector will operate as a dual-mode system that switches between scene layer inspection (nothing selected) and prim inspection (object selected).

enum InspectorTarget {
  case sceneLayer          // Global scene properties
  case prim(path: String)  // Specific USD prim
}

Layer Inspection (Nothing Selected)

Data Sources

When a scene URL is set, the inspector triggers loadLayerData(), which extracts metadata from the USD stage, which returns a USDStageMetadata struct containing:

Spatial Configuration:

  • upAxis (Y or Z coordinate system)
  • metersPerUnit (unit conversion factor)
  • defaultPrimName (entry point prim)

Animation/Playback:

  • startTimeCode / endTimeCode (timeline bounds)
  • timeCodesPerSecond (frame rate)
  • autoPlay and playbackMode (behavior flags)
  • animationTracks (list of animation names)

For now, the animation UI in the inspector will be read-only and will not trigger any type of global animation, as that will require some runtime animation component tweaking to get it right; having a data representation is our prize at the moment.

Prim Inspection (Object Selected)

Data Loading Sequence

When a user selects a node in the scene navigator, the inspector triggers a cascade of async data loading:

  1. Immediate: Selection ID stored in state
  2. Async Batch: Multiple parallel queries:
    • allMaterials() - Discovers available materials for binding dropdown
    • getPrimAttributes() - Retrieves prim metadata (type, visibility, purpose)
    • getPrimTransform() - Gets position, rotation, scale
    • materialBinding() - Current material assignment
    • primReferences() - External file references

Where the Transforms Are

The essential data handled by the inspector for any prim selection is the Transform. It presents human-readable Decomposed Components (TRS) and also enables real-time editing of those components. When the values are changed, they persist directly in the USD.

Here is an example showing the result of placing a cube on the RCP and transforming it.

Screenshot of Reality Composer Pro on macOS showing a 3D viewport with a white cube that has been rotated and scaled. The Cube object is selected in the Scene hierarchy on the left, highlighted in orange. On the right, the inspector panel displays Transform properties with Position values of 10, 20, 30 cm, Rotation values of 10, 20, 30 degrees, and Scale values of 2, 3, 4. Additional sections for References, Material Bindings, and Cube Primitive are visible below in the inspector. The cube appears tilted in the viewport with a transform gizmo visible.
def Cube "Cube" (
    customData = {
        float3 rotationEulerHint = (0.17453292, 0.34906584, 0.52359885)  # RADIANS!
    }
)
{
    quatf xformOp:orient = (0.9515485, 0.03813458, 0.18930785, 0.23929836)
    float3 xformOp:scale = (2, 3, 4)
    float3 xformOp:translate = (0.1, 0.2, 0.3)
    uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"]
}

What You See vs. What Gets Saved

The UI (RCP Inspector)

  • Displays: Position (cm), Rotation (Euler degrees) and Scale (on the metersPerUnit scale)
  • Shows the result of matrix decomposition
  • Units converted for human readability (meters → cm, radians → degrees)
ℹ️
In 3D graphics, a 4x4 Affine Transformation Matrix is constructed by multiplying three distinct matrices together in a specific order (usually Scale × Rotation × Translation, or S·R·T)

USD Persistence

  1. Runtime representation: Quaternion (xformOp:orient) + scale (xformOp:scale) + translate (xformOp:translate)
  2. Transform order: Explicit xformOpOrder array defines operation sequence

The customData = { float3 rotationEulerHint = (rad, rad, rad) } is RCP's "metadata gift." When RCP opens a USD file authored elsewhere (no rotationEulerHint), it:

  • Reads the quaternion from xformOp:orient
  • Converts to Euler (radians) for convenience

This is pure syntactic sugar. If you open that file before it has interacted with RCP, you'll see the quaternion, not Euler angles.

Release 5-inspector-basics · elkraneo/Deconstructed
5-inspector-basics