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)
3060
[ X ] I have verified that all unit tests pass with the proposed changes
[ X ] I have submitted a signed Contributor License Agreement
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)
3060
[ X ] I have verified that all unit tests pass with the proposed changes
[ X ] I have submitted a signed Contributor License Agreement