Understanding USD import/export in SOPS/LOPS

   2895   4   2
User Avatar
Member
207 posts
Joined: Nov. 2015
Offline
Hi;

I don't know what search terms to use to describe a question I have, so I'll try asking it here:

I have an obj file I snagged from an online marketplace; I'd like to convert it to USD. I read it in a sopnet node, and if I just reference this output in a SopImport, I see what I expect to see, which is the object, separated into gprims according to shader assignment:



I insert a USDExport SOP with default settings, and write out a USD file. I then insert a USDImport file (again with default settings), and output this from my sopnet instead. I see in SOPs that I have a "packed USD". In Solaris, my scene graph looks different now...I can no longer see the mesh prims, and the icon next to the root node looks different:



In LOPS, if I Reference in the USD file I just exported, I get a scene graph tree that looks like what I expect, and matches what I get without the USD export/import bit:



I feels like I'm missing an extra traversal step or something when I read my exported usd file, am I warm with that guess?

Attached is a hip file demonstrating this.
Edited by dhemberg - Aug. 7, 2022 16:35:01

Attachments:
usd_1.png (44.4 KB)
usd_2.png (47.9 KB)
usd_3.png (44.6 KB)
usd_test.hiplc (154.1 KB)

User Avatar
Member
27 posts
Joined: May 2015
Offline
Well, you wanted to pack your object into USD, and you did. It's not just geometry. If you wanna have it back, with ability to edit, you can use USD Unpack (or even Unpack node) after the import. If I understood you issue correctly
User Avatar
Member
273 posts
Joined: Nov. 2013
Offline
I looks like sopimport lop doesn't automatically unpack packed usd. Rather it wants to apply the transform from the packed prim onto the corresponding prim on the stage, which in your case isn't useful. I think if you usdunpack (to polygons) you'll get what you're expecting. It's a little surprising there's not an unpack option in the sopimport params.
User Avatar
Member
7737 posts
Joined: Sept. 2011
Offline
dhemberg
Hi;

I don't know what search terms to use to describe a question I have, so I'll try asking it here:

I have an obj file I snagged from an online marketplace; I'd like to convert it to USD. I read it in a sopnet node, and if I just reference this output in a SopImport, I see what I expect to see, which is the object, separated into gprims according to shader assignment:

Image Not Found


I insert a USDExport SOP with default settings, and write out a USD file. I then insert a USDImport file (again with default settings), and output this from my sopnet instead. I see in SOPs that I have a "packed USD". In Solaris, my scene graph looks different now...I can no longer see the mesh prims, and the icon next to the root node looks different:

Image Not Found


In LOPS, if I Reference in the USD file I just exported, I get a scene graph tree that looks like what I expect, and matches what I get without the USD export/import bit:

Image Not Found


I feels like I'm missing an extra traversal step or something when I read my exported usd file, am I warm with that guess?

Attached is a hip file demonstrating this.

I'm confused why you are using those nodes at all. You already have a sop import to bring the geometry onto the stage, Using a USD export short circuits that. To use your sopimport as before, use a usd rop with the sop import connected. For re-import use a reference or sublayer node on the stage. I can't see a situation where you would ever use the usd import/export nodes where you are already using the LOP nodes.
User Avatar
Staff
4159 posts
Joined: Sept. 2007
Offline
USD Import has unpacking options, but the low-level LOP Import SOP is meant to import USD Prims into SOPs as packed prims. This lets you apply simulations or other rigid transforms efficiently. It can also be the case that you want to import some models in a scene as SOP geometry, some as individual USD Prims, and perhaps import a big chunk of a scene as a single USD Packed Prim (either for crude collisions or just visual reference). If you are just doing rigid transforms, unpacking USD prims is usually just making Houdini do more work, when round-tripping between LOPs and SOPs.

@dhemberg, the USD Import/Export nodes are largely aimed at file-based USD workflows; you would want to just use a Reference LOP to read the exported USD assets from disk. USD Export can be useful, but if you need to do more USD-facing work on your asset, such as materials or other tweaks, the Component Builder [www.sidefx.com] nodes might be worth looking into.
I'm o.d.d.
  • Quick Links