UsdUtils.ModifyAssetPaths strips empty paths from asset array attributes
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
- Extract the attached asset_array.usda: asset_array.zip
- 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())
- 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
Filed as internal issue #USD-9595
Thanks, @marktucker - agreed and we'll try to get this addressed for the next release.
Thanks. I have a PR that I just need to do a little more testing on before I submit it for your approval (hopefully).