Pages

Showing posts with label Blender. Show all posts
Showing posts with label Blender. Show all posts

Wednesday, February 3, 2021

Post 4: Create a USD asset with NXT

  

 USD Asset Creation

Post 4

In this blogpost on asset creation using USD we are going to look at shading also known as the Look of the asset.

To do this I am going to be using blender(cos free) and the RpR Hydra Addon also free...


Once you have that up and running it should look something like this:


Brain also did a Youtube video on how it works inside Blender:







You can also hook up NXT with blender if you want. BlenderAddon




Eventually we will use this workflow to build our USD assets in a more "artist" friendly manner. For now lets look at what we need to do USD wise to add in shading.

Sixth Layer (Payload look)

As always you can find the look nxt graph in the repo here.

Adding in the payload for the look could not be simpler in NXT. 

1. Create a new layer above the modelingsublayers layer

2. Instance the whole of the model payload(orange circle) onto this new layer and add it into your graph as shown in image below

3. Edit your new payload instance to save out as the look.usda stub(all the nodes that are yellow have been edited)

4. Save out the new look.usda(take note that it is not parented under the model save-purple node- it is a sibling)



Something you want to pay attention to is the List Position when you add in payloads, references and so on:

Front places the assets path at the top of the payload list, Back places at the bottom of that list. 

Something you can also do is place the model payload under the model def and the look payload under the look def, instead of in the same list as shown in images below.
So that you can list edit those separately from each other.


Something like this:



To do this I swapped the child order of when the payload gets made vs. when the model and look definition gets created:



Really cool that I can do this in NXT with pretty much zero hassle, I just change the order of the child nodes on the Stage Open node.


This post is getting pretty long, in the next post we will examine the look sublayers and what we can build for those. 


To be continued in Post 5 . . .



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