Make a USD file
So you wanna save a USD? Just like you're saving .bgeo or .abc, but all universal n shit? Fine.
- Get into sops
- Make a pig
- Save your hip as i_heart_usd.hip
- Append a USD Export sop
- Jump to the second tab of its parameters, set the output path to $HIP/geo/pig.usd
- Click save to disk.
Congrats! You're now a master of USD!
Load a USD file
Oh, you wanna load it back in? Who are you, Pixar or something?
- Stay in sops
- Put down a USD Import sop
- Set the path to $HIP/geo/pig.usd
- Admire the pig.
Sweet eh? Middle click on the node, note that its a single point with a single prim, a packed USD. What if you wanted to modify this?
Unpack a USD prim
- Append a 'unpack usd to polygons'
Done! And if you're still in the hip with the original pig sop, even the materials have been restored.
Ok, so what?
Right, so even at this stage there's a few things worth pointing out.
Used this way, USD ia almost a 1:1 drop in replacement for bego and alembic. There's differences of course, but generally the tradeoffs are pretty good:
- They're smaller than either alembics or bego
- They'll load in other dcc's with less data loss (bego loads only in houdini of course, usd has many tricks alembic lack)
- When saved and loaded in this way, its mostly transparent to the houdini user; all attributes are stored on save, read back on load, its fast to work with
- Most common geo types are supported this way; polys, curves (ie fur/hair), points, nurbs (sorta), packed prims (sorta sorta), subdivs.
- Volumes are NOT supported this way, but we'll get to that later.
Kick the tyres some more
Don't trust words, try it yourself:
- Create a grid, scatter some points, save it to test.usd. Load it back in, the points are there as a packed usd prim. Unpack to polygons, all the points are available.
- Create a line copytopoints it to the points, save to test.usd, load it, thats there too.
- Scale the pig down to about 0.15, turn on 'pack and instance' on the copytopoints, swap the line for the pig. Save.
- Load it back in, its a single packed usd of all the pigs.
- View the unpack node and... ruh roh. 2 million polys? Eh?
- Take a look in the geo spreadsheet, as well as path and name on the prims, there's usdpath and usdprimpath. Make a note of that. At the point level there's also usdxform, also interesting.
Unpack vs unpack
Bring up the tab menu again and type 'unpack', you'll see that there's 'unpack usd' and 'unpack usd to polys'. Try 'usd unpack', and you'll see you get 1000 usd prims. Compare the parameters on usd unpack vs usd unpack to polygons, you can see they're the same node, just the geometry type dropdown is different.
This implies that USD can store hierarchies, packs of packs. Interesting.
Enough of this. Lets move onto part 2!