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

UsdUtils.ModifyAssetPaths strips empty paths from asset array attributes #3060

Closed
marktucker opened this issue Apr 26, 2024 · 3 comments
Closed

Comments

@marktucker
Copy link
Contributor

marktucker commented Apr 26, 2024

Description of Issue

UsdUtils.ModifyAssetPaths strips empty asset paths from asset array attributes. This makes sense for composition arcs, but for attributes/primvars, this kind of arbitrary manipulation of array contents (and lengths!) is likely to break things. This change appears to be new, probably cause when ModifyAssetPaths moved over to the AssetLocalization framework.

Steps to Reproduce

  1. Extract the attached asset_array.usda:
    asset_array.zip
  2. Run the following script in python:
def cb(asset):
    return asset

from pxr import Usd, UsdUtils, Sdf
l = Sdf.Layer.FindOrOpen("asset_array.usda")
print(l.ExportToString())
UsdUtils.ModifyAssetPaths(l, cb)
print(l.ExportToString())
  1. The result should be completely unchanged (since the callback doesn't change any asset paths), but instead the empty asset paths have been stripped from the asset array.

Package Versions

24.03

@jesschimein
Copy link
Contributor

Filed as internal issue #USD-9595

@spiffmon
Copy link
Member

Thanks, @marktucker - agreed and we'll try to get this addressed for the next release.

@marktucker
Copy link
Contributor Author

Thanks. I have a PR that I just need to do a little more testing on before I submit it for your approval (hopefully).

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

3 participants