Skip to content

feat(ui): UsdUI (SceneGraphPrimAPI / NodeGraphNodeAPI / Backdrop)#98

Open
bresilla wants to merge 2 commits into
mxpv:mainfrom
bresilla:feat/ui
Open

feat(ui): UsdUI (SceneGraphPrimAPI / NodeGraphNodeAPI / Backdrop)#98
bresilla wants to merge 2 commits into
mxpv:mainfrom
bresilla:feat/ui

Conversation

@bresilla
Copy link
Copy Markdown
Contributor

@bresilla bresilla commented Jun 1, 2026

Adds UsdUI behind a ui feature, read + author - the cosmetic metadata authoring tools use for outliners and node-graph editors (all under the ui: namespace):

  • SceneGraphPrimAPI (applied) - ui:displayName / ui:displayGroup.
  • NodeGraphNodeAPI (applied) - node-editor layout: pos, size, stackingOrder, displayColor, icon, expansionState (open/closed/minimized), docURI.
  • Backdrop (concrete prim) - ui:description; also carries the NodeGraphNode layout attributes.

UsdUI attributes have no spec defaults, so unauthored fields read as None. Hand-authored fixture + in-memory roundtrips.

Copilot AI review requested due to automatic review settings June 1, 2026 11:25
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds support for the UsdUI schema family (reader + authoring) behind a new ui feature flag, along with fixture-based coverage.

Changes:

  • Introduces schemas::ui module with tokens, decoded types, read helpers, and authoring helpers.
  • Adds unit + integration tests plus a USDA fixture file to validate roundtrips and fixture decoding.
  • Wires the new ui feature into Cargo.toml and the schema module registry, and documents it in the roadmap.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/ui_reader.rs New integration test that reads UsdUI values from a fixture stage
src/schemas/ui/types.rs Adds decoded read structs and ExpansionState enum
src/schemas/ui/tokens.rs Defines UsdUI token constants for schema/property names and enum values
src/schemas/ui/read.rs Implements read functions for SceneGraphPrimAPI, NodeGraphNodeAPI, and Backdrop
src/schemas/ui/mod.rs Public module surface + unit tests for author/read roundtrips
src/schemas/ui/author.rs Authoring helpers to apply APIs, define Backdrop, and author attributes
src/schemas/mod.rs Registers the ui schema module behind the ui feature
fixtures/usdUI_scene.usda Adds fixture used by integration test
ROADMAP.md Updates roadmap to mark UsdUI as implemented
Cargo.toml Adds ui feature and a feature-gated integration test target

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/schemas/ui/read.rs
Comment on lines +77 to +83
fn read_int(stage: &Stage, prim: &Path, name: &str) -> Result<Option<i32>> {
Ok(match attr_value(stage, prim, name)? {
Some(Value::Int(i)) => Some(i),
Some(Value::Int64(i)) => Some(i as i32),
_ => None,
})
}
Comment thread src/schemas/ui/read.rs Outdated
Comment on lines +56 to +68
fn read_token(stage: &Stage, prim: &Path, name: &str) -> Result<Option<String>> {
Ok(match attr_value(stage, prim, name)? {
Some(Value::Token(s) | Value::String(s)) => Some(s),
_ => None,
})
}

fn read_string(stage: &Stage, prim: &Path, name: &str) -> Result<Option<String>> {
Ok(match attr_value(stage, prim, name)? {
Some(Value::String(s) | Value::Token(s)) => Some(s),
_ => None,
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants