Hello!
Looking at the documention for the Sdf.Reference class, there appear to be c++ functions for settings/getting the assetPath, primPath, etc. But, in python I don’t see these methods. There are attributes for assetPath, primPath, etc on the object, but it looks like there are only getters for these. I don’t seem to be able to set the value after object creation.
>>> ref = Sdf.Reference()
>>> ref.assetPath = "c:/file.usda"
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: can't set attribute
But I do seem to be able to set them on an Sdf.Payload:
TL;DR - The SdfReference behavior is the one we want - here’s why . We should downgrade the Payload behavior - if you wanted to file a GitHub issue on this, it would be appreciated.
Here’s how it happened: originally, payloads in USD were not list-editable - you could only have one on each prim! So the situation as described in wrapReferences.cpp couldn’t happen for payloads. When, in 2017, we made payloads list-editable, we did not scrutinize the python wrappings, and just didn’t notice we were opening up this potential for confusing authoring behavior.