How to get usd metadata into sops as attributes.

   5020   6   2
User Avatar
Member
289 posts
Joined: 7月 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 - 2021年12月7日 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
スタッフ
407 posts
Joined: 2月 2008
Offline
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
289 posts
Joined: 7月 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
スタッフ
407 posts
Joined: 2月 2008
Offline
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
36 posts
Joined: 11月 2013
Offline
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
14 posts
Joined: 11月 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
8780 posts
Joined: 7月 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 - 2022年4月7日 13:14:13
Tomas Slancik
FX Supervisor
Method Studios, NY
  • Quick Links