Pages

Showing posts with label NXT. Show all posts
Showing posts with label NXT. 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 . . .



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

Friday, January 8, 2021

Post 1: Create a USD asset with NXT

 USD Asset Creation

Post 1

Trying to create a USD asset can turn into quite the journey...


When building USD assets you need to keep a few things in mind:

1. ModelAPI

2. Payload, Reference, Sublayer

3. LIVERPS

4.Variants

5. Classes

6. usda, usdc, usd

7. Prims

and much more... read the glossary!


Each one of these points are there to help departments after the asset has been made to better interact with said asset.

Pixar's Create Asset Tutorial

If we take a look at Pixar's python example to Create an Asset, we can quickly see that a lot of what's going on in this script has nothing to do with an actual 3d asset(as in open up zbrush and sculpt mesh). 



 Where to find things related to an asset(payloads, references). What is it (component, assembly, mesh)? And general 3d environment info (axis=y, unit size).

So why use USD?

USD



 Well in short, the admin required to make assets would normally be handled by the artists/TDs/pipelineTDs on the fly(people intensive and boring) with many department specific tools. This can create a lot of headaches as it gets handed off to all the different departments and software along the line. USD knows what the pipeline needs and allows you to build it into your assets from the start. Now you end up with, not just the 3D geometry but also a Universal Description of what that means.... a "SMART Asset". That can be used in any software that support USD.

So why use NXT?

NXT



NXT's visual code style and ability to layer and instance nodes and graphs around suits USD very well. In my opinion NXT adds a needed level of management to USD that makes it more "user friendly" without the TD having to subscribe to any DCC's workflow/integration and drawbacks. It works more inline with USD's core idea of "Universal" and "Open".

All the below tutorial graphs can be found here: nxt_usd_graphs

USD core Library in NXT...

I have already started to make a core lib of USD nodes for NXT and we will be using a lot of them make our asset template.

USD NXT LIB


Note: I'm ignoring the variants for now. I Will do variants in an up coming blog post.


First Layer (Open/Create)

Here we will simply create the top level foo.usda stub file.

We will use three nodes:

findOrOpen, OpenStage and RootLayerSave nodes. They are all part of the usd_core(red)
layer in NXT.




We are going to create a new layer above the tools layer(pink) and instance these nodes into that layer like:


When you execute this layer(see NXT docs on how this works). You should end up with a USD that looks like this:


An "empty" usda. Please note that we will be doing all the tuts as usda so we can see what gets written into the usd files. For geo and large data sets usdc files are a much better file type.

If you are unsure of where to find your usda file check your USD_file attrubute:



Second Layer (Stage data)

Now lets create a second layer above our first layer and add in some basic stage data:


Set Stage Axis allows us the ability to tell any DCC what the up Axis for a give USD is.


By making the axis a attribute in NXT it can easily be updated or changed as we add layers.

Next we set the scene scale:


This is super helpful when going between different DCC's(software) like Maya and Houdini.

Now when we execute our NXT graph we should end up with a foo.usda that looks like this: 


Next post we will add the main prim data and a payload to that prim.

To be continued in Post 2 . . .


Monday, December 7, 2020

Opensource project NXT/USD

NXT


nxt_graphs_usd



So for the last month or so I have been working on a opensource project(nxt_graphs_usd) that builds off of USD Pixars awesome pipeline API, inside of another opensource project called NXT(Node eXecution Tree).




USD NXT fusion baby!


In my repo you will find a bunch of useful nodes for building up USD files, like authoring variants. 

The example below is based off of Pixars own tutorials.



I will be adding to this repo on and off, so there will be more updates coming.


End...