You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When calling UsdUtils.ComputeAllDependencies in Python (and I imagine in C++ as well), only the first returned Layer, the input Layer, has expected identifier and resolvedPath values.
Steps to Reproduce
Write a custom resolver where MyCustomResolver::_CreateIdentifier and MyCustomResolver::_Resolve return different values (if you want a minimum repro, I can write one)
uri="database:top_uri.usda"dependency="database:I_am_a_dependency.usda"UsdUtils.ComputeAllDependencies(uri)
layer=Sdf.Layer.FindOrOpen(dependency)
layer.identifier# "databaseresolvedpath:/path/to/I_am_a_dependency.usda" <-- This changed!layer.resolvedPath# "databaseresolvedpath:/path/to/I_am_a_dependency.usda"
As mentioned in the related usd-interest forum post, I don't know if this is somehow intended behavior but it causes problems in other areas. For example:
uri="database:top_uri.usda"dependency="database:I_am_a_dependency.usda"layers, assets, unresolved=UsdUtils.ComputeAllDependencies(uri) # <-- Note, ``dependency`` is a sublayer / reference / payload in ``uri``, so it gets modified as a result of ``uri`` being calledlayer=Sdf.Layer.FindOrOpen(dependency)
layer.identifier# "databaseresolvedpath:/path/to/I_am_a_dependency.usda" <-- Expected "database:I_am_a_dependency.usda" aka ``dependency``layer.resolvedPath# "databaseresolvedpath:/path/to/I_am_a_dependency.usda"layer.assetName# ""layer.version# ""layer.GetAssetInfo() # {}# ... etc ...
Note that even though the identifier / URI dependency was given to layer = Sdf.Layer.FindOrOpen(dependency), the returned layer still has a returned identifier of "databasepath:/path/to/I_am_a_dependency.usda"
Possible explanation why this is happening
I'm guessing that somewhere within UsdUtils.ComputeAllDependencies implementation, when accessing dependent Layers, roughly the following code is being called
Because the resolvedPath of the dependency is being passed as input to Sdf.Layer.FindOrOpen, the layer that's opened, the returned Layer is forced to treat its input text as an identifier.
Then the returned Layer would have "identifier as identifier, resolvedPath as resolvedPath", as opposed to "resolvedPath as identifier, resolvedPath as resolvedPath"
System Information (OS, Hardware)
Package Versions
USD 22.08 (This bug, I've noticed in USD 19.11 as well, in Ar 1.0)
If "Possible explanation why this is happening" is a correct guess, then it makes sense why anonymous Layers being passed to UsdUtils.ComputeAllDependencies(anonymous.identifier) return empty. After all, if you call Ar.GetResolver().Resolve on an anonymous Layer, it always returns an empty string!
I posted this before hearing back on that post. Apologies if this post is a bit premature, but I figured a GitHub issue is probably the best place to discuss this specific behavior (bug?)
The text was updated successfully, but these errors were encountered:
Description of Issue
When calling
UsdUtils.ComputeAllDependencies
in Python (and I imagine in C++ as well), only the first returned Layer, the input Layer, has expected identifier and resolvedPath values.Steps to Reproduce
MyCustomResolver::_CreateIdentifier
andMyCustomResolver::_Resolve
return different values (if you want a minimum repro, I can write one)Without ComputeAllDependencies:
With ComputeAllDependencies:
As mentioned in the related usd-interest forum post, I don't know if this is somehow intended behavior but it causes problems in other areas. For example:
Without ComputeAllDependencies:
With ComputeAllDependencies:
Note that even though the identifier / URI
dependency
was given tolayer = Sdf.Layer.FindOrOpen(dependency)
, the returnedlayer
still has a returned identifier of "databasepath:/path/to/I_am_a_dependency.usda"Possible explanation why this is happening
I'm guessing that somewhere within
UsdUtils.ComputeAllDependencies
implementation, when accessing dependent Layers, roughly the following code is being calledBecause the resolvedPath of the
dependency
is being passed as input toSdf.Layer.FindOrOpen
, the layer that's opened, the returned Layer is forced to treat its input text as an identifier.Instead, I would've expected this code:
Then the returned Layer would have "identifier as identifier, resolvedPath as resolvedPath", as opposed to "resolvedPath as identifier, resolvedPath as resolvedPath"
System Information (OS, Hardware)
Package Versions
Build Flags
A default
build_usd.py
installRelated Information
Possibly related issue: #2073
If "Possible explanation why this is happening" is a correct guess, then it makes sense why anonymous Layers being passed to
UsdUtils.ComputeAllDependencies(anonymous.identifier)
return empty. After all, if you callAr.GetResolver().Resolve
on an anonymous Layer, it always returns an empty string!Related Information, Continued
A (rather long) usd-interest forum post: https://groups.google.com/g/usd-interest/c/JSfSTNIJRug
I posted this before hearing back on that post. Apologies if this post is a bit premature, but I figured a GitHub issue is probably the best place to discuss this specific behavior (bug?)
The text was updated successfully, but these errors were encountered: