Pages

Showing posts with label Modelling. Show all posts
Showing posts with label Modelling. Show all posts

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 . . .


Monday, January 11, 2021

Post 2: Create a USD asset with NXT

 

 USD Asset Creation

Post 2

Please see Post 1... 
If you have already...



You can find the following NXT layers here: ThirdLayer, FourthLayer


Third Layer (Prim data)

In this layer we are going to focus on the prim data for our asset, That includes things like: 
Asset Info - for this example I'm setting the asset ID, name and version. But you should really read through and understand ModelAPI to really use this to your advantage.
Inheritance: See class specifiers in the USD doc's for more on this, but classes are super powerful.
Also we will set what Kind the asset is(once again see model API for more on this from a usd perspective).


What you really want to do is start to pay attention to the structure of this USD file we are building:


As you can see in the top image, we have a block of code that is in between two (). This is our stage data(local data) for this layer.
Then we have our prim def that holds the primitive specific data(what is foo?).
After that we have our empty class that we inherit from in the prim.
This structure is super important for when you want to later "traverse" the stage and find info(more on traversal later tho).



Forth Layer (Payload model)

Next up we will add a payload to the foo prim definition using a new layer(purple). 


All the nodes that are now purple, I had to slightly tweak to make the payloading work for me. 
This is part of what makes NXT so amazing to me. If I need to change a bit of code for some reason I can so on the layer I'm working in. 
Knowing that the previous code is still on the layer below if I need to revert back all I do is delete the node on my purple layer.




When making the payload we are basically doing two things: Creating a usda file on disk.



And authoring the path to that layer into the original foo.usda.



What that looks like as usd:



Now the modelling department have their own layer to work with for the asset called foo. 
What makes this cool is that they don't ever have to actually edit the top level foo.usda. This is really important for colab with other departments(I will show this later)
The top level foo.usda can technically be managed now by the pipeline tools and would never need an artist to touch it.


Removing a whole lot of admin from them in the process.

Next post we will add some common info/workflow into the modelling layer for that department.

To be continued in Post 3 . . .