Difference between revisions of "UsdGuide11"

From cgwiki
 
(14 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
=== Layers ===
 
=== Layers ===
  
We talked earlier about layering in the context of departments, but not layers.  
+
We talked earlier about layering (as a verb) in the context of departments, but not layers (as a noun) within USD.  
  
The Pixar docs talk about layers in a well meaning but somewhat abstract way, containers and photoshop and stuff. I found I understood it better with specific examples, as well as the dreaded counter examples.
+
Anything you do in USD is implicitly in a layer, a layer being the broadest 'container' USD has. So when you make a primtive from scratch, it's put in a layer. When you load a reference, the reference is put in a layer.
  
''placeholder notes''
+
You can load stuff from disk directly into a layer, skipping the reference style 'put this thing there' requirements. This simplest way of doing this is a '''sublayer''' lop, it just vomits the contents of a file on disk directly to the scene graph. Being the simplest way, its also the default way when you put down a file node.
  
Anything you do in usd is implicitly in a layer.
+
This leads to a basic rule with layers; '''a layer should always be associated with a path on disk'''. If you load something with a sublayer, that's self evident, the path on disk is of course the usd file you loaded.  
  
When you create a reference, it's put in its own layer.
+
But what about when you use a sop create? That usd geo didn't come from disk, its been generated from nothing, so there's no save path defined. This can have an impact on USD Rops, hence you get control over this with save styles.
  
It's also why a file lop is an alias for 'sublayer', the usd method for loading stuff from disk without the reference tricks.
+
=== Save style ===
  
A layer is usually linked with a path on disk, this is obvious with a sublayer or reference, that path is the usd file you loaded.
+
The rop 'save style' menu is to decide how layers should be saved. Obviously. The text within the menu choices is pretty self descriptive, but here's my loose paraphrasing. Say you've chained together a sublayer from disk, a reference on disk, and a sopcreate within lops. The save styles let you choose between:
  
But what about when you use a sop create? That usd geo didn't come from disk, its been generated from nothing, so there's no save path defined.  
+
* If you've loaded stuff from disk, leave them alone, just store any of the edits/overrides in the final usd file specified on the rop. OR:
 +
* Take all the contents of all the inputs (except references), bake them into the usd specified in the rop. OR:
 +
* Bake everything into the usd specified in the rop, so you have a big fat usd file, no external dependencies.
 +
 
 +
So what happens to the sopcreate if it doesn't have a path on disk, and you don't use the 'bake everything' mode?
 +
 
 +
Ideally, an error. In practice, a mess. A USD Rop will do this little process when you click 'save to disk':
 +
 
 +
* Scan all the incoming layers
 +
* Identify layers that have been modified
 +
* Save them to their own 'layer save path'
 +
* Once all the layers are taken care of, write its own usd file.
 +
 
 +
In this case the sopcreate layer will have a pretend save path based on the houdini sop path, eg op:/obj/geo1/polyextrude. The preprocess step will do its best, save the layer to a not-very-helpful location like $HIP/obj/geo1/polyextrude.usd, generate a warning like 'you know i had to save that sopcreate layer to a stupid place right?', and you swear. Ugh.
 +
 
 +
To avoid this mess, look for a 'layer save path' parameter. It exists on sop create and sop modify. Enable it, give it a path (eg $HIP/geo/cool_fx_geo.usd).
 +
 
 +
Now when you click 'save' on the usd rop, the layer save preprocess will do the right thing. Hooray!
  
That doesn't matter until you append a rop, at which point yes it matters.
+
Why would you need this? Modularity and fine grained control, which USD excels at (arguably USD and Lops gives you ''too'' much fine grained control). You might have something like this chain of nodes:
  
The rop 'save style' menu is to decide what layers should do, and yes, there's photoshop analogies here. You could do several things
+
* A sop import for building the set
 +
* A sop import for doing an RBD sim
 +
* A sop create for running fur,
 +
* A USD Rop at the end with a save path of 'master.usd'.
  
* If you've loaded stuff from disk, leave them alone, just store any of the edits/overrides in the usd specified in the rop
+
With the appropriate layer save paths per sopimport/sopcreate, when you save the rop you'll get seperate set.usd, rbd.usd, fur.usd, which will all be references automatically by the tiny master.usd file.
* Take all the contents of all the inputs (except references), bake them into the usd specified in the rop
 
* Bake everything into the usd specified in the rop, so you have a big fat usd file, no external dependencies.
 
  
Ok, so again, what happens when you save a sop create if you don't use the 'bake everything' mode?
+
In reality, this doesn't happen often with fx and lops. Any important external stuff will already be in external usd files, and you'll just be told 'yeah, just throw all your FX work into fx.usd please.'. In that case, just set the save style to 'flatten', job done.
  
Ideally, an error. In practice, a mess. The layer will have a pretend save path baed on the houdini sop path, so op:/obj/geo1/polyextrude. If you hsave, you'll likely get a warning, and a subfolder like $HIP/obj/geo1/polyextrude.usd. Ugh.
+
=== Scene Graph Layers pane ===
  
To fix, look for a 'layer save path' parameter. It exists on sop create and sop modify, point that to where you want your little sop network to be saved.
+
If you want to keep track of your layers (and sooner or later you'll want to), there's a panel for this, Scene Graph Layers. Open it, see a tree-ish view of the active layers. This also lets you see the save paths at a glance per layer, handy to spot the one rogue layer which doesn't have a path set, or is trying to save to op:/obj/geo1/polyextrude.  
  
When you click save to disk on the usd rop, any layers that have a save path defined, that need to be saved to disk, will be saved to disk.
+
=== Configure Layer ===
  
Why would you need this? If you had lots of complex sop creates, one for buidling the set, another for pulling in an RBD sim, another for the fur, and you want the final output to be a small 'master.usd', while next to it are big seperate files for set.usd, rbd.usd, fur.usd.
+
You don't have to configure 'layer save path' straight away on a sopcreate/sopimport. A 'configure layer' node also lets you do this, handy if you want to bundle your operations, eg keeping all the rops and save-path related nodes close together at the bottom of your node network.
  
In reality, this rarely happens with lops. You'll likely be pulling in set.usd from someone else, so you don't have to worry about save paths, and you'll be told 'just put all the fx stuff into fx.usd'. In that case, just set the save style to 'flatten', walk away.
+
----
  
There's a kind of confusing, kind of useful 'scene graph layers' pane, pop it open, click through some of the flows we've created so far, see how the layers have evovled. Also note the handy 'save path' column to tell you when things will save to dumb locations.
+
prev: [[UsdGuide10]] this: [[UsdGuide11]] next: [[UsdGuide12]] <br>
 +
main menu: [[UsdGuide]]

Latest revision as of 21:35, 5 June 2021

Layers

We talked earlier about layering (as a verb) in the context of departments, but not layers (as a noun) within USD.

Anything you do in USD is implicitly in a layer, a layer being the broadest 'container' USD has. So when you make a primtive from scratch, it's put in a layer. When you load a reference, the reference is put in a layer.

You can load stuff from disk directly into a layer, skipping the reference style 'put this thing there' requirements. This simplest way of doing this is a sublayer lop, it just vomits the contents of a file on disk directly to the scene graph. Being the simplest way, its also the default way when you put down a file node.

This leads to a basic rule with layers; a layer should always be associated with a path on disk. If you load something with a sublayer, that's self evident, the path on disk is of course the usd file you loaded.

But what about when you use a sop create? That usd geo didn't come from disk, its been generated from nothing, so there's no save path defined. This can have an impact on USD Rops, hence you get control over this with save styles.

Save style

The rop 'save style' menu is to decide how layers should be saved. Obviously. The text within the menu choices is pretty self descriptive, but here's my loose paraphrasing. Say you've chained together a sublayer from disk, a reference on disk, and a sopcreate within lops. The save styles let you choose between:

  • If you've loaded stuff from disk, leave them alone, just store any of the edits/overrides in the final usd file specified on the rop. OR:
  • Take all the contents of all the inputs (except references), bake them into the usd specified in the rop. OR:
  • Bake everything into the usd specified in the rop, so you have a big fat usd file, no external dependencies.

So what happens to the sopcreate if it doesn't have a path on disk, and you don't use the 'bake everything' mode?

Ideally, an error. In practice, a mess. A USD Rop will do this little process when you click 'save to disk':

  • Scan all the incoming layers
  • Identify layers that have been modified
  • Save them to their own 'layer save path'
  • Once all the layers are taken care of, write its own usd file.

In this case the sopcreate layer will have a pretend save path based on the houdini sop path, eg op:/obj/geo1/polyextrude. The preprocess step will do its best, save the layer to a not-very-helpful location like $HIP/obj/geo1/polyextrude.usd, generate a warning like 'you know i had to save that sopcreate layer to a stupid place right?', and you swear. Ugh.

To avoid this mess, look for a 'layer save path' parameter. It exists on sop create and sop modify. Enable it, give it a path (eg $HIP/geo/cool_fx_geo.usd).

Now when you click 'save' on the usd rop, the layer save preprocess will do the right thing. Hooray!

Why would you need this? Modularity and fine grained control, which USD excels at (arguably USD and Lops gives you too much fine grained control). You might have something like this chain of nodes:

  • A sop import for building the set
  • A sop import for doing an RBD sim
  • A sop create for running fur,
  • A USD Rop at the end with a save path of 'master.usd'.

With the appropriate layer save paths per sopimport/sopcreate, when you save the rop you'll get seperate set.usd, rbd.usd, fur.usd, which will all be references automatically by the tiny master.usd file.

In reality, this doesn't happen often with fx and lops. Any important external stuff will already be in external usd files, and you'll just be told 'yeah, just throw all your FX work into fx.usd please.'. In that case, just set the save style to 'flatten', job done.

Scene Graph Layers pane

If you want to keep track of your layers (and sooner or later you'll want to), there's a panel for this, Scene Graph Layers. Open it, see a tree-ish view of the active layers. This also lets you see the save paths at a glance per layer, handy to spot the one rogue layer which doesn't have a path set, or is trying to save to op:/obj/geo1/polyextrude.

Configure Layer

You don't have to configure 'layer save path' straight away on a sopcreate/sopimport. A 'configure layer' node also lets you do this, handy if you want to bundle your operations, eg keeping all the rops and save-path related nodes close together at the bottom of your node network.


prev: UsdGuide10 this: UsdGuide11 next: UsdGuide12
main menu: UsdGuide