PixarAnimationStudios / OpenUSD

Universal Scene Description
http://www.openusd.org
Other
5.45k stars 1.13k forks source link

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

Open marktucker opened 2 weeks ago

marktucker commented 2 weeks ago

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())


4. 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 commented 2 weeks ago

Filed as internal issue #USD-9595

spiffmon commented 2 weeks ago

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

marktucker commented 2 weeks ago

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