Pages

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


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


Thursday, December 3, 2020

Learning USD

For the last year I've been busy learning USD .  Here's a sneak peak at it, I will be posting more coming soon.....



Wednesday, April 16, 2014

Learning Houdini with help from Softimage ICE


Voronoi Diagram



So seeing as Softimage is going to be "put down" by Autodesk, I have started the processes of going over to Houdini. To make it as easy on myself as possible I'm doing Softimage Tutorials and finding their "equivalent" Houdini tutorial so I can compare and judge(just kidding Houdini I wont judge).

The first of these Tutorials I've found is on the Voronoi Diagram. The Tutorial for Softimage is done by Nika Ragua ---> Voronoi shattering and explains the math behind the effect.

For Houdini I'm using the Digital Tutors - Controlling your fractures in Houdini Tutorial. 
Both these Tutorials deal with Voronoi Diagrams and how the math deals with splitting up volumes in 3d and 2d space. 

Here is what that looks like on my screen O_O

Click to enlarge

Moving over to a new software is never easy, and losing ICE saddens me :C But Houdini seems like it might just be able to distract me from the pain....

End