Skip to content
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

UsdUtilsComputeAllDependencies - Anonymous layers return empty #2073

Closed
ColinKennedy opened this issue Oct 28, 2022 · 1 comment
Closed

UsdUtilsComputeAllDependencies - Anonymous layers return empty #2073

ColinKennedy opened this issue Oct 28, 2022 · 1 comment

Comments

@ColinKennedy
Copy link

ColinKennedy commented Oct 28, 2022

Description of Issue

When using anonymous Layers, UsdUtils.ComputeAllDependencies is empty. I've noted this in the Python binding version but probably the C++ implementation has the same problem.

Steps to Reproduce

  1. Make a custom resolver where a Layer's identifier differs from its resolvedPath equivalent
  2. Observe the following behavior:
from pxr import Sdf, UsdUtils

layer = Sdf.Layer.CreateAnonymous(".usda")
layer.subLayerPaths.append("/tmp/foo_bar_thing.usda")
layers, assets, unresolved = UsdUtils.ComputeAllDependencies(layer.identifier)

"/tmp/foo_bar_thing.usda" should either be in layers, as [Sdf.Find("/tmp/foo_bar_thing.usda")] or in unresolved ["/tmp/foo_bar_thing.usda"] but it's in neither. layers, assets, and unresolved are all empty.

If you export to a file and then use that Layer's identifier then the "/tmp/foo_bar_thing.usda" path shows up as expected.

import os
import tempfile

from pxr import Sdf, UsdUtils

_, path = tempfile.mkstemp(suffix="_test_usdutils_anonymous.usda")
layer = Sdf.Layer.CreateAnonymous(os.path.splitext(".usda")[1])
layer.subLayerPaths.append("/tmp/foo_bar_thing.usda")
layers1, assets1, unresolved1 = UsdUtils.ComputeAllDependencies(layer.identifier)

layer.Export(path)

layers2, assets2, unresolved2 = UsdUtils.ComputeAllDependencies(path)

layers1, assets1, and unresolved1 are all empty, whereas layers2, assets2, and unresolved2 have the expected data.

System Information (OS, Hardware)

  • CentOS 7

Package Versions

  • USD: 22.08
  • Python 3

Build Flags

A default build_usd.py build

Related Information

A (rather long) usd-interest forum post: https://groups.google.com/g/usd-interest/c/JSfSTNIJRug

@ColinKennedy ColinKennedy changed the title UsdUtilsComputeAllDependencies - Anonymous layer return empty UsdUtilsComputeAllDependencies - Anonymous layers return empty Oct 28, 2022
@sunyab
Copy link
Contributor

sunyab commented Nov 4, 2022

Filed as internal issue #USD-7736

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants