Skip to content

Commit

Permalink
Ar2 uses the parentPath as an anchor
Browse files Browse the repository at this point in the history
This updates the ArResolver2.0 code path to use the source
file as an anchor. This allows relative references to work
with non-filename asset references. Usd Manager has some
internal path manipulation to allow relative paths to work
with plain file paths, but it needs to use the resolver
plugin for non file paths. This logic already exists when
dealing with the ArResolver1.0 API, but when the 2.0 i
support was added this was overlooked.

Signed-off-by: Peter Shinners <[email protected]>
  • Loading branch information
pshinners committed Jan 26, 2024
1 parent 40473f4 commit 1d2b6ba
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion usdmanager/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,8 @@ def expandPath(path, parentPath=None, sdf_format_args=None, extractedDir=None):
if parentPath is None:
anchoredPath = path
elif hasattr(resolver, "CreateIdentifier"):
anchoredPath = resolver.CreateIdentifier(path)
anchor = resolver.Resolve(parentPath)
anchoredPath = resolver.CreateIdentifier(path, anchor)
else:
anchoredPath = resolver.AnchorRelativePath(parentPath, path)
resolved = resolver.Resolve(anchoredPath)
Expand Down

0 comments on commit 1d2b6ba

Please sign in to comment.