PixarAnimationStudios / OpenUSD

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

Don't let UsdUtilsModifyAssetPaths change the length of asset array attributes/metadata #3063

Open marktucker opened 2 weeks ago

marktucker commented 2 weeks ago

Description of Change(s)

When modifying asset paths in a layer, don't remove empty elements from arrays. The empty elements may be meaningful, as in primvars that must be a specific length. Updated the output of the ModifyAssetPaths "removal" test, which validates the behavior of this API when modified asset paths are empty.

Arguably, this change should perhaps be limited to USD attributes (not metadata), but depending on the use case changing the array length is still throwing away what may be important information in a pipeline.

I also considered whether an array that has all values set to empty asset paths should remove the attribute. This seems more defensible to me, but again, I'm not sure the length of the array couldn't still be considered useful information that is worth preserving in some circumstances.

I'm open to different answers on these two questions, and I believe each could be addressed without too drastic changes to this PR.

Fixes Issue(s)

jesschimein commented 2 weeks ago

Filed as internal issue #USD-9598

jesschimein commented 2 weeks ago

/AzurePipelines run

azure-pipelines[bot] commented 2 weeks ago
Azure Pipelines successfully started running 1 pipeline(s).