-
-
Notifications
You must be signed in to change notification settings - Fork 9
feat(stage): add references_in() and payloads_in() arc enumeration #44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| #usda 1.0 | ||
| ( | ||
| defaultPrim = "Root" | ||
| ) | ||
|
|
||
| def Xform "Root" | ||
| { | ||
| def "WithReference" ( | ||
| references = @./ref_target.usda@</World> | ||
| ) | ||
| { | ||
| } | ||
|
|
||
| def "WithPayload" ( | ||
| payload = @./ref_target.usda@</World> | ||
| ) | ||
| { | ||
| } | ||
|
|
||
| def "NoArcs" | ||
| { | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -104,6 +104,90 @@ impl Stage { | |||||||||||||||||||||||||||||||||||
| self.composed_children(&path.into(), ChildrenKey::PropertyChildren) | ||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| /// Returns the references declared on a prim, collected from every layer | ||||||||||||||||||||||||||||||||||||
| /// that has a spec at the given path. | ||||||||||||||||||||||||||||||||||||
| /// | ||||||||||||||||||||||||||||||||||||
| /// Unlike the composition engine's internal arc resolution (which follows | ||||||||||||||||||||||||||||||||||||
| /// references across files), this method reads only the **as-authored** | ||||||||||||||||||||||||||||||||||||
| /// `references` field of each layer spec. It is intended for asset-health | ||||||||||||||||||||||||||||||||||||
| /// inspection tasks such as detecting broken or missing references before | ||||||||||||||||||||||||||||||||||||
| /// attempting full composition. | ||||||||||||||||||||||||||||||||||||
| /// | ||||||||||||||||||||||||||||||||||||
| /// Duplicate entries from multiple layers are included as-is; callers can | ||||||||||||||||||||||||||||||||||||
| /// de-duplicate if needed. The ordering is strongest-layer-first. | ||||||||||||||||||||||||||||||||||||
|
Comment on lines
+111
to
+117
|
||||||||||||||||||||||||||||||||||||
| /// references across files), this method reads only the **as-authored** | |
| /// `references` field of each layer spec. It is intended for asset-health | |
| /// inspection tasks such as detecting broken or missing references before | |
| /// attempting full composition. | |
| /// | |
| /// Duplicate entries from multiple layers are included as-is; callers can | |
| /// de-duplicate if needed. The ordering is strongest-layer-first. | |
| /// references across files), this method reads only the authored | |
| /// `references` entries surfaced by the underlying list-op iteration for | |
| /// each layer spec. It is intended for asset-health inspection tasks such | |
| /// as detecting broken or missing references before attempting full | |
| /// composition. | |
| /// | |
| /// This does not expose every authored list-edit bucket: deleted and | |
| /// ordered entries are not included. Duplicate entries from multiple | |
| /// layers are included as-is; callers can de-duplicate if needed. The | |
| /// ordering is strongest-layer-first. |
Copilot
AI
Apr 7, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
references_in silently skips layer.get(...) errors (even after has_field), which can hide real decode/IO issues (e.g. USDC value decoding failures) and return incomplete results without any signal. Consider changing the API to Result<Vec<Reference>> and propagating get errors (or at least distinguishing missing-field from other errors and surfacing the latter).
Copilot
AI
Apr 7, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
payloads_in also swallows layer.get(...) errors and will silently return partial results if decoding fails. For consistency with other Stage queries (and to avoid hiding layer corruption), consider returning Result<Vec<Payload>> and propagating non-missing errors after the has_field check.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fixture references/payloads
</World>inref_target.usda, butfixtures/ref_target.usdadefinesdefaultPrim = "Source"and the root prim is/Source(no/World). If this mismatch is intentional (to model a broken arc), it would help to add a brief comment in the fixture; otherwise consider changing the prim path to</Source>so the fixture is self-consistent.