How to get usd metadata into sops as attributes.

   2437   6   2
User Avatar
Member
288 posts
Joined: July 2005
Offline
Hello everyone,

I'm trying to get access to usd metadata in sops. But I'm struggling to figure out how.
E.g as put in the image I would like to get the id as a string attribute on the primitives or points.

Cheers!

Edited by kgoossens - Dec. 7, 2021 17:02:18

Attachments:
MetaData.png (274.8 KB)

A computer is almost human - except that it does not blame its mistakes on another computer.
User Avatar
Staff
214 posts
Joined: Feb. 2008
Online
You could use a python SOP, or here's an example hipfile using a wrangle to access the LOP imported prim's metadata.

Attachments:
MetaDataToSOPs.hip (116.1 KB)

User Avatar
Member
288 posts
Joined: July 2005
Offline
Thank you!! This helps me forward.

So I now have added some custom data in the metadata. I do see "customData" appearing as a key, but when I try to get access to it, the values don't show. I also tried "customData:myCustomData"

Attachments:
MetaData2.png (616.2 KB)

A computer is almost human - except that it does not blame its mistakes on another computer.
User Avatar
Staff
214 posts
Joined: Feb. 2008
Online
For more complex data types you'll need to go through python I'm afraid. Some data types won't be able to be assigned as attributes though since there may not be geometry data types that support it.
User Avatar
Member
29 posts
Joined: Nov. 2013
Online
kgoossens
but when I try to get access to it, the values don't show. I also tried "customData:myCustomData"

Just came across this post while also looking for extracting Meta Data from USD files. Your mentioned "customData:myCustomData" which works for me. Thx

Attachments:
usd_meta.jpg (175.3 KB)

User Avatar
Member
11 posts
Joined: Nov. 2016
Offline
datas in customData are complex data,they are not just string ,int or float...
so if you write the vex like this
usd_metadata("op:/stage/OUT","/sopcreate1","customData")
It certainly didn't work.
the best way is Separate readings.
Thx.
User Avatar
Member
7138 posts
Joined: July 2007
Offline
it would be great if there is dictionary version of usd_metadata() that would bring such data in as dictionary
Edited by tamte - April 7, 2022 13:14:13
Tomas Slancik
FX Supervisor
Method Studios, NY
  • Quick Links