Remove a USD attribute from the layer it is defined?

   5804   3   0
User Avatar
Member
46 posts
Joined: 1月 2018
Offline
I want to do the equivalent of a stage manager operation on an attribute.

It's not really a valid USD operation, as far as I understand it. However, if I know that the primitive is defined in the same layer, I'm hoping that there is a way simply to remove it. Or omit it from being written to the USD file at write time would also be fine.

Is there a way to do this?

Thanks!
User Avatar
スタッフ
4517 posts
Joined: 7月 2005
Offline
If you know that you're still editing the same layer where the attribute was originally defined, there are Sdf APIs to clear a property setting from an SdfLayer (and you can use a Python LOP to invoke these). With nodes, the closest you can get it using an Edit Properties node to Block an attribute. But I think that will author an explicit block, hiding lower strength opinions rather than revealing them as would happen if you cleared the opinion on the active layer. My concern with exposing this as a node based operation is that there are so many situations in which this won't do the expected thing (because opinions are authored in layers other than the active one).
User Avatar
Member
46 posts
Joined: 1月 2018
Offline
Okay, thanks I'll look into the Sdf API :-)
I guess the same concern should apply to the stage manager too, right? Since deleting a prim from a layer won't actually delete it if the prim is defined elsewhere?
User Avatar
スタッフ
4517 posts
Joined: 7月 2005
Offline
This is why the stage manager flattens all layers into one (by default): so there is just the one layer that holds all the data. This way the Sdf APIs don't need to worry about “where” a prim is defined, because they are all defined on the active layer.
  • Quick Links