USD Asset Build with Geo & Mtls as Payload



Posted: 2023-05-24

I recently built a custom asset builder for my company to replace the standard Houdini Component Builder. The CB was working well, but we started feeling to limited by its features, the lookdev team were not enjoying working across multiple locations inside the hda and its workflow did not fit well into our pipeline.

The component builder out puts 4 or 5 files depending on your setup/use case its quite logical in that it has:

There was not a lot of information out there on the Houdini workflow for creating this structure, so I hope to cover it here and explain exactly what we are doing in each step.

Asset Structure

I am also building assets keeping the ASWF USD Working Group’s Guidelines in mind, however I will not be focussed on matching everything 1:1 in this blog post as this will be more focussed on the Payloading of the Geo & Material Layers. So for example I wont setup the /proxy and /render purposes or set our asset to be a Component Kind.

In my pipeline tools I use as many channel references and procedural worksflows as possible but here I will keep it simple and consistently create my asset called asset_name at the root path /.

Geo

First up we need to create some geo. Drop in a Sphere and set its Primitive Path to /asset_name/$OS. I assume you will either setup/create your geo in a Sop Create or similar workflow, but here this sphere will represent the totality of our geo configuration. So lets next drop down a Configure Layer and set the Save Path to $HIP/asset/geo.usda.

usd_assetbuild_geo

Material

Branch from your Sphere and drop in a Layer Break. The reason for this is inside of the mtl.usda we do not want to store the geo data again, since it is already being saved to its own layer. Next we can create a Material Library along with a Assign Material.

Inside the material library you can create the shaders you need that are specific to your render engine, or if you are wanting to switch renders you can consider using the Collect node to link them all up for a single assignment. I am going to set the Material Path Prefix to /asset_name/mtl/. So that the materials are stored under our asset, but inside a mtl scope.

Assign your shader to the geo on the Assign Material node.

Finally create a second Configure Layer and set the Save Path to $HIP/asset/mtl.usda.

usd_assetbuild_mtl

Reference Layers

Once we have configured the two layers above we need to setup the structure to reference the two inputs into a single file that we will call payload.usda. This file does not do the work of payloading perse but simply references the two files into a single layer.

Dropping down a Reference node lets setup all the internals correctly. First up, Clear all File and Internal References and unfold the Multi-input carot. We need to continue placing everything in our /asset_name path so place that as your Primitive Path. Next the Action, here we want to Edit Exisiting Primitives. This makes the node interpret the prim path as a pattern, so that the reference is added to every prim that matches this pattern. Reference Type will be Reference Inputs and finally Reference Primitive should be set to Reference Specific Primitive with the Reference Primitive Path set to match /asset_name.

Next create a Primitive node and simply enter /asset_name in Primitive Paths.

Now connect the Primitive node to the first input of your Reference node, and both the geo and mtl Configure Layers to the second input.

Finally drop in a 3rd and final Configure Layer and set its Save Path to $HIP/asset/payload.usda.

usd_assetbuild_referencelayer

Payload Layer

Finally we get to the Payload. This is actually going to be our main asset_name.usda file which payloads the payload.usda. Time to drop down a Payload node which will automatically drop down a Loft Payload Info node. As per the help, the loft payload info node adds basic info from inside the payload to the prim that loads the payload. So you can simply set the Primitives on the Loft to *.

Lets configure that Payload node. Connect the Primitive node from earlier to the first input, and connect the payload.usda configure layer node to the second input.

On the payload node, Clear all File and Internal References and unfold the Multi-input carot. We need to continue placing everything in our /asset_name path so place that as your Primitive Path. Next the Action, here we want to Create New Primitives, with everything else left as default. You might want to setup the Create Primitive tab according to your component requirements though.

Finally a USD ROP node can be added to rop all this data out to $HIP/asset/asset_name.usda.

usd_assetbuild_payloadlayer

The final completed network will look something like this:

usd_assetbuild_fullnetwork

Video Instructions

Download Sample Scene File