Round-tripping detail attributes SOPs <--> USD

   1138   2   2
User Avatar
Member
162 posts
Joined: Feb. 2016
Online
Hi, I was wondering if it's possible to import constant usd primvars/attributes as detail attributes?
I'm storing some asset specific detail attributes in sops, I would like to be able to import them straight back to detail attributes with usdimport in sops.

I did notice that I get a detail attribute listing the constant attributes, so now I'm attribute promoting them after the unpack.
usdconfigconstantattribs & usdconfigscalarconstantattribs

Would be nice if constant attributes were at least available on the Packed USD's in sops, seems like only name/path is a available.

I did also notice that the usdanimimport node imports blend shape weight values straight to detail attributes, so maybe there is hope?

Attaching a test scene
Edited by AslakKS - Dec. 8, 2022 06:07:25

Attachments:
USD_experiments_detail-roundtrip_v001.hip (257.1 KB)

User Avatar
Staff
734 posts
Joined: Oct. 2012
Offline
The underlying reason for this behaviour is that when you import multiple prims which have different values for the same detail attribute, the stricter merge used when unpacking packed prims will promote from a detail to a prim attribute to avoid losing those values. The Unpack USD SOP chooses to always import constant primvars as prim attributes because of this, so that the attributes don't unexpectedly change from detail to prim depending on whether you're importing other USD prims - that behaviour was problematic for downstream setups that expect attributes to be in a certain class. The downside is that you do need to promote back to detail attributes if your setup requires them and you're only importing one prim

usdconfigconstantattribs is recognized by SOP Import (like attributes set up by the USD Configure SOP) so that those attributes can be round-tripped back to USD as constant primvars

There is also an RFE #124148 for allowing constant attributes to be imported onto packed USD prims as you mentioned.
User Avatar
Member
162 posts
Joined: Feb. 2016
Online
Thanks for the information, it makes sense.
I hope we can get them on the packed USD prims one day
  • Quick Links