I'd like to import dictionary attributes into lops primitive from sops. Ideally on SOP Import node so I don't have to replicate current workflow, this is already very rich
Currently it doesn't seem supported.
- Is there a builtin way to do that? Just map to primvars would work great
- Can I inject my own code to importer? I don't mind to write a custom processor if it's possible. I don't like writing this in Python LOP downstream
I'm just trying to import a fairly complicated scene that I then use in game engine. I'm attaching lot of metadata like convex hulls, collision shapes and other game related stuff.
It's possible just to define point attributes, but sops attaching attribute to every point. Dicts would be ideal as a primvars container for custom primitives from sops.
Import dict attributes from SOPs to LOPs
702 3 0-
- elovikov
- Member
- 151 posts
- Joined: June 2019
- Offline
-
- tamte
- Member
- 9380 posts
- Joined: July 2007
- Offline
elovikovI don't think there is on LOP side since usd primvars don't have equivalent type of dict attribs and even when expanding to primvar per key there would probably be ambiguities in terms of nested dicts or name collisions with existing attribs etc.
- Is there a builtin way to do that? Just map to primvars would work great
however in SOPs you can add Attribute Adjust Dictionary set name to your dict attrib and enable Export Attributes: *
that will extract the keys as attributes
you can make a wrapper around SOP Import for this or set it up inside of SOP Create where you bring your data as Object Merge and then extract dict attribs
Edited by tamte - June 13, 2025 09:49:47
Tomas Slancik
CG Supervisor
Framestore, NY
CG Supervisor
Framestore, NY
-
- elovikov
- Member
- 151 posts
- Joined: June 2019
- Offline
Thank you, Tomas!
Export Attributes on Adjust Dictionary is really handy, thanks for pointing out.
also good point on nested dicts
I agree it's a weird one but I'd even expand dictionary and created a nested primitive for every dict entry
basically I'd map js object encoded in json dict to usd prim
It is esoteric but open up some really flexible stuff when I need to pass some rich data from houdini
(I tried work exclusively in sops and gltf but it's exhausting)
Export Attributes on Adjust Dictionary is really handy, thanks for pointing out.
also good point on nested dicts
I agree it's a weird one but I'd even expand dictionary and created a nested primitive for every dict entry
basically I'd map js object encoded in json dict to usd prim
It is esoteric but open up some really flexible stuff when I need to pass some rich data from houdini
(I tried work exclusively in sops and gltf but it's exhausting)
-
- elovikov
- Member
- 151 posts
- Joined: June 2019
- Offline
Tried to make it work but essentially looks like python lop is the only way at the moment. Unpacking dicts on attributes create too many clashes.
Also I've messed up as usual with usd terms, I was after mapping dict to prim attributes, not primvars
I've made a little hda with a simple mapping script for anybody interested in the same approach.
It looks for point attribute d@usd_prims and maps it to child prims (including nested dictionaries). It follows the convention of SOP Import and uses usdprimtype as a prim type. It doesn't overwrite type of already defined one so it mostly makes sense for fake prims via sop points.
Simple example inside.
Probably the next step is supporting codeless schemas, but right now it's just a way to bubble up some structured data from sops
Also I've messed up as usual with usd terms, I was after mapping dict to prim attributes, not primvars
I've made a little hda with a simple mapping script for anybody interested in the same approach.
It looks for point attribute d@usd_prims and maps it to child prims (including nested dictionaries). It follows the convention of SOP Import and uses usdprimtype as a prim type. It doesn't overwrite type of already defined one so it mostly makes sense for fake prims via sop points.
Simple example inside.
Probably the next step is supporting codeless schemas, but right now it's just a way to bubble up some structured data from sops
-
- Quick Links

