Complete UsdShade NodeDef source queries - #134
Merged
Merged
Conversation
Shader implementation data previously exposed only raw universal attributes, leaving callers to
interpret implementationSource and construct source-type-specific property names themselves. The composed
queries now select the active identifier, source-asset, or source-code family and fall back to identifier
mode for unauthored or invalid selectors.
Source assets, asset sub-identifiers, and inline source code support source-type-specific lookup with
universal fallback. Source-type discovery follows the active implementation family, defined properties
correctly block fallback, and asset results retain their authored, evaluated, and resolved paths.
Shader, Input, and Output expose composed sdrMetadata maps, keyed lookups, and presence queries. Focused
and integration tests cover selection, fallback, metadata composition, malformed data, and resolved source
assets, with the UsdShade documentation and roadmap updated for the completed query surface.
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.
The existing UsdShade layer exposed universal NodeDef attributes but left callers
to interpret info:implementationSource, construct source-type-specific property
names, and apply fallback rules themselves. That made it possible to inspect the
raw scene description, but not to reliably determine which shader
implementation was active or obtain the definition metadata needed by a
material-network consumer.
What it does
Adds the composed NodeDef query surface needed to identify shader
implementations without rebuilding OpenUSD selection rules downstream:
Resolves the active info:implementationSource, falling back to identifier
mode when the value is unauthored, mistyped, or unrecognized.
Returns info:id only while identifier mode is active; the raw id_attr
accessor remains available for generic USD inspection.
Queries universal and source-type-specific source assets, asset
sub-identifiers, and inline source code.
Falls back to the universal property only when the requested
source-type-specific property is not defined. A defined but valueless
property remains authoritative.
Discovers source types from properties belonging to the active
implementation family while preserving composed property order.
Returns source assets as composed sdf::AssetPath values, retaining their
authored, evaluated, and resolved paths.
Adds the public SdrMetadata map and composed whole-map, keyed, and presence
queries for shaders, inputs, and outputs.
Shares NodeDef selection through private prim-based helpers so a future
NodeDefAPI view can reuse the behavior.
Updates the UsdShade documentation, roadmap, unit tests, and integration
coverage, including resolved source assets and layered metadata composition.
The query layer preserves the distinction between valid string-valued
sdrMetadata entries and malformed values: map and keyed-value queries omit
invalid entries, while presence queries still report their authored keys.
This stops at structural NodeDef discovery. It does not add an SdrRegistry,
shader-parser plugins, shader dialect parsing, or shader compilation. A
separate Sdr-compatible layer can consume these results to provide node
signatures and fallback values, while renderer integrations remain responsible
for lowering supported definitions into executable shaders.