Repository navigation
Load sublayers authored on anonymous layers - #166
Merged
Merged
Conversation
An anonymous parent's unresolved subLayers entry was dropped before it reached the load barrier, so an absolute path never opened and nothing reported it. The entry now files a demand like any other parent's: it resolves without an anchor, as C++ SdfComputeAssetPathRelativeToLayer does for an anonymous layer, and a missing asset reports UnresolvedSublayer. Fixes mxpv#165. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VvoGc8yq9e7gZnCrKA4qeZ
An anonymous layer's relative asset paths were anchored against its identifier, anon:<n>:<tag>. A tag with a directory or a .usdz extension changed what a sublayer, reference or clip path named. These paths resolve with no anchor, as C++ SdfComputeAssetPathRelativeToLayer does for an anonymous layer. With no anchor, DefaultResolver::create_identifier applies the look-here-first rule against the working directory. A search path absent from it keeps its bare spelling and resolves through the search directories.
mxpv
force-pushed
the
fix-anon-absolute-sublayer
branch
from
October 23, 2026 23:40
477c75c to
33b6414
Compare
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.
Fixes #165.
Problem
When an anonymous layer had a
subLayersentry that wasn't loaded yet,LayerGraph::file_stack_discoveriesdropped the entry before it reached thestage's load barrier. An absolute-path sublayer authored on an anonymous layer
therefore never opened. That covers both
Stage::insert_layerand authoring onthe anonymous root of
Stage::builder().in_memory(...).composition_errors()stayed empty, so the opinions disappeared without any diagnostic.
Fix
This follows C++. An anonymous layer's resolved path is empty, so
SdfComputeAssetPathRelativeToLayercreates the entry's identifier without ananchor and the layer stack opens it like any other sublayer. A missing asset
reports
PcpErrorInvalidSublayerPath.The skip is removed, so an anonymous parent's unresolved entry now becomes a
load request like any other parent's:
UnresolvedSublayer.through the existing bare-name fallback.
References and payloads authored on anonymous layers already went through this
path, so sublayers now behave the same way. The
Stage::insert_layerdocsalready described this behavior.
There is one behavior change. A relative entry on an anonymous layer that names
no in-memory layer is now also looked up on disk. If it isn't found it reports
UnresolvedSublayer, as C++ does, where before it was silently ignored.Tests
pcp::layer_graph::tests::anon_parent_demandsreplacesanon_parent_no_demand, which asserted the old skip.usd::stage::tests::anon_absolute_sublayercovers cases A and B from theissue.
usd::stage::tests::anon_missing_sublayer_reportschecks that a missing filereports
UnresolvedSublayer.All three tests fail without the fix.
cargo test --workspace --all-targets --all-features,cargo clippy --workspace --all-targets --all-features -- -D warnings,cargo docandcargo fmt --checkpass.