Pages

Sunday, January 17, 2021

Post 3: Create a USD asset with NXT

 

 USD Asset Creation

Post 3

In the last blog post on Asset Creation(Post 2) we created our first prim with a payload for the modelling department. But that is just the first step. 

What we now need to build are layers that will help modelling work proficiently.
First step is splitting up the geometry and the UV's, and creating some namespaces for good house keeping. 

We will also look at how an artist can interact with USD and how that would effect how we build our USD layers as a pipeline TD.


You can find this layer here: FifthLayer

Fifth Layer (Geom/UV Sublayers)

Now lets start with the geom sublayer:

We will be sub-layering(not payloading) into the model.usda a layer called geom.usda.

The reason we want to sublayer is so that it merges with any other sublayers we want to add from the artist. 
It also gives pipeline a USD(model.usd) to write USD specific fixes too as a departmant(this is not foo.usda that's for pipelineTDs), on top of anything modeling artist provides the pipeline. Now you can adjust data without having to actually alter the artist "files"(they will probably update them and you don't want to lose your fixes).




Lets take a look at the layers in USDVIEW


Blender

Lets add some actual 3D mesh to our geom.usda stub. 


If we crack open Blender 2.91 we can Export a usda file as shown in the image above, BUT.

We instantly run into some issues:

First problem: At the moment you can export USD out of blender but you can't import. So we cant start our "artist" off with the stub USD files we have made(if you use Houdini or Maya you can import those as a starting point).

If we export out of blender like shown above, we are just overriding all the setup we did, see image below. 



Now this wont break our overall setup(because we are sub-layering geom into model.usd), but we will lose all the stage data we added into the original stub.

To fix this we would need to build our own custom tools for when an artist starts their task(setup the correct hierarchy /foo/model/geom - Import tool -), And an Export tool to insure they don't just hard copy over our stub USD.

Second problem: Blender doesn't know what overrides are(cant just click a button to tell it to save a layer as overrides instead of defs). So we would need the custom exporting tool to know when we want to save as overrides.

Third problem: Blender saves its own data into the USD file(see above image). This is a pain but we can ignore it, or we could remove it with your custom exporter.

So we now need two more tools with UI for modelling in blender. 

This is why departments tend to have their own dedicated TDs. Most departments will have more then one DCC that they use, so bare that in mind when you build tools.

In this imaginary 3D studio they use blender for their modelling department. But it could just as easily have been Maya and Zbrush or 3D Studio Max and Mud Box. This is why USD/NXT is so important for pipeline. Having universal tools that can speak to all these DCC's is a life saver.


Moving on...

Wouldn't it be nice if we could use NXT to make the importer and exporter you say. Well . . .


But for now we will focus on the USD layers themselves, I will do a spin off blogpost on these two tools in future.

Back to USD...


Now lets instance the NXT node stack for the geom and make the UV node stack:


Say I want to change the order of my sublayers, with NXT its easy. I just place the green circles graph(uv) before the red(geom). Now when I run the code(after deleting old files) I get that the UVs are the strongest opinion(stomps on the geom UVs) which is great. UV's are always being updated and not always by the person who models the asset(obviously if point order changes then the uvs would break).




Also you would want to make the UV layer use an override not a prim definition:



 See top images for how I did that.

Now lets see what this all looks like put together in USDVIEW.



In the next post we look at the next department Look(texturing and shading).


To be continued in Post 4 . . .


No comments: