feat(render): UsdRender schema + computed render spec#90
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds a new render feature implementing the UsdRender schema reader/authoring surface plus an end-to-end computed render spec, validated against a fixture scene.
Changes:
- Introduces
UsdRendertokens, decoded types/defaults, readers, authoring helpers, and computedRenderSpec(compute_render_spec). - Implements aspect-ratio conform policy application and namespaced render-delegate settings gathering.
- Adds fixture + integration/unit tests; wires up
renderfeature flag and test target.
Reviewed changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/render_reader.rs | New integration tests validating reading + computed spec against a fixture stage. |
| src/schemas/render/mod.rs | New render module surface and re-exports for readers/authoring/spec compute. |
| src/schemas/render/tokens.rs | Central token/attribute/relationship constants for UsdRender. |
| src/schemas/render/types.rs | Decoded enums + read structs with schema-faithful Default fallbacks and round-trip tests. |
| src/schemas/render/read.rs | Reader implementations for settings/product/var/pass + camera aperture + relationship/value helpers. |
| src/schemas/render/spec.rs | Value types for the computed flattened RenderSpec. |
| src/schemas/render/conform.rs | Aspect-ratio conform policy implementation + unit tests. |
| src/schemas/render/compute.rs | Spec computation logic (flattening, overrides, conform, var de-dup, namespaced settings) + unit tests. |
| src/schemas/render/author/* | Authoring helpers for settings/product/var/pass and shared base setters + tests. |
| src/schemas/mod.rs | Registers render schema module behind the new render feature. |
| fixtures/usdRender_scene.usda | Hand-authored fixture scene used by integration tests. |
| Cargo.toml | Adds render feature and render_reader integration test gated by it. |
| ROADMAP.md | Marks UsdRender as implemented on main and documents remaining gaps. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
The aspect-ratio guard only rejected a zero resolution height or aperture height, so resolution[0] <= 0, a negative aperture, or a non-positive pixelAspectRatio still reached the divisions and produced an inf/NaN or negative aperture. Widen the guard to match C++ _ApplyAspectRatioPolicy (res/aperture both positive, imageAspectRatio positive) and cover every case in the test.
read_rel_targets read the raw TargetPaths field via Stage::field and flattened a single layer's list op, so products / orderedVars / inputPasses / camera / renderSource dropped prepend/append/delete edits contributed by weaker sublayers and references. The reader then disagreed with compute_render_spec, which already resolves these through the composing relationship-target API. Route read_rel_targets through Stage::relationship_targets, which folds list-op edits across every contributing layer (C++ GetTargets).
get_stage_render_settings read renderSettingsPrimPath off the absolute root, which resolves through root-layer-only metadata and ignores session-layer and sublayer opinions. A session layer setting the metadata (a standard render-override workflow) was silently dropped, diverging from C++ UsdRenderSettings::GetStageRenderSettings, which reads it via UsdStage::GetMetadata. Add Cache::stage_metadata / Stage::stage_metadata, which compose the pseudo-root opinion session-over-root, and route the reader through it. Also accept an AssetPath-typed opinion, not just String/Token.
Replace the **bold** emphasis pattern (forbidden by CLAUDE.md) with plain text in the render reader/types/tokens/author docs. Clarify that instantaneousShutter is deprecated in the C++ UsdRender schema and is read only so older assets that author it round-trip.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds UsdRender behind a
renderfeature — the RenderSettings / RenderProduct / RenderVar / RenderPass schemas (read + author) plus the computed render spec.The spec computation is the interesting part, built up in small commits each with its own tests: product-overrides-settings inheritance (the authored-only
_Getrule), the aspect-ratio conform policy (all five modes), render-var de-duplication into a global list, and per-levelnamespacedSettingsgathering.No vendored UsdRender conformance assets exist, so validation is a hand-authored
usdRender_scene.usdafixture plus in-memory author→read roundtrips.Left as documented seams: node-graph-driven namespaced settings (need UsdShade value resolution), authoring the
renderSettingsPrimPathstage metadata (needs a generic root-layer metadata setter — reading works), and UsdRenderDenoisePass (still a dev schema).The
RenderPassvisibility/prune/matte collection memberships are gated on UsdCollectionAPI, which I've since put up in #92 — once that lands I'll wire the RenderPass collections on top in a small follow-up.