# Material Assignment
In this document we provide an overview of the material assignment workflow in Multiverse for Maya. You will learn how to assign material overrides, how materials are inherited in the hierarchy, and how the order of overrides works.
The meaning of _"assignment"_
It is important to understand that the information that Multiverse writes in the USD files is the material assignment, and not the full description of material shading networks.
Material assignment is the mapping that represents which material name (shading engine/group) is assigned to which item (prim name). If these materials exist in Maya (they can already exist in the scene or Maya-referenced), then the respective renderer will be able to procedurally resolve the assignment at render time.
Material assignment is the only reliable information in this context because:
The process of serializing and de-serializing a production shading network in USD is inherently lossy.
USD files should be kept renderer-agnostic (for this reason the only reliable shading network that can be written in USD is based on the USD preview material ones, see Preview Material).
The bottom line is that is much better to keep the shading networks in a Maya file/reference (since they are small anyway) and encode in USD only the name of the shading engine (shading group) assigned to a USD primitive.
Note that when using Maya references the reference namespace can assigned to, ideally, the root primitive of a USD file via MEOW's attribute set overrides. See Material Assignment with Namespace
Note also that Multiverse procedurals work by inheritance and therefore assigning a material to a root prim will broadcasts to all children prims if not overridden locally.
So, let’s start by writing some Maya geometry to USD: we will use the captivating “Maneki Neko” model asset, which you can Download here.
Model License
The “Manekineko” 3D model by J Cube Inc is provided under CC BY-SA 4.0 License. For any purpose of use, you must respect the license conditions.
# Write the Asset
Select the root node of Maneki and perform a “Write USD Asset” operation using
the exact same settings as in the image below, then write the manekineko.usd
file clicking the icon on the shelf:
# Read the Asset
You can now hide/delete the original Maya hierarchy, or even make a new Maya
scene, then read manekineko.usd
generated inthe previous step with a “Read
USD Asset” operation:
In the Maya outliner you will see the “Multiverse Compound” node (node type:
mvUsdCompoundShape
), simply referred as “Compound” from now on, with its
blue-ish icon.
A Compound streams the USD data into Maya through the Multiverse Hydra viewports, while no heavy data is present in Maya:
# Explore in MEOW
Select the Compound node and open the MEOW panel (which stands for "Multiverse Explore & Override Window") with the shelf icon, you will also see that it encapsulates the very same hierarchy of your original Maya data:
# Material assignment
Add a light and render the scene — we will use Arnold in this example as is the
default Maya renderer — you’ll see that the material assigned to the Compound
node is the standard Maya lambert1
: you should know that this is the default
Maya behavior, any new shape that comes in Maya is typically assigned to
lambert1
:
The following sections will describe the different way materials can be assigned for use in Multiverse:
- Node-Level Assignment: the material assigned to the Compound shape node
- Per-location Assignment a. Maya Material Assignment written in USD (overrides 1) b. MEOW Material Assignment (overrides 2a)
- Node-Level Assignment
# Node-level Assignment
This is the basic form of material assignment in Maya (and therefore in
Multiverse). In Maya each shape can be connected to a material via a Shading
Group (the correct name for this node is actually shadingEngine
, but it is
better known as Shading Group, or SG, and we will use this name from now on):
shape node → shading group node
You can of course assign any material than lambert1
to a Compound shape node
using any standard Maya assignment ways, and of course, all the hierarchy items
encapsulated in the compound will be rendered using that material. Simply try to
assign your renderer’s material, such as Arnold aiStandardSurface
, 3Delight
dlStandard
, VRay vrayMaterial
, Renderman PxrSurface
, Redshift
redshiftMaterial
etc.
# Per-Location Assignment
# Maya Material Assignment written in USD
Let’s go back to the original asset, this time we will assign some materials to the individual shapes of Maneki, and give it some colors. We will use Lambert materials and procedural textures instead of files, so to make it very generic, but you can use make your favorite renderer shading networks of course.
Let's re-do the writing operation we did before but with material assignment:
select the root node manekineko
and click on the Write USD Asset on the shelf,
this time however we will make sure the ”material assignment” option is set to
ON, and we will write: manekineko_with_mat.usd
:
Hide/delete the original Maya hierarchy, however this time do NOT make a new Maya scene since we need the material shading networks we made.
Namespace
Materials shading networks can be Maya-referenced from other Maya scenes, all you need to do is make sure to specify a "namespace" by creating an attribute override in MEOW on the root location of your asset and specify the namespace for the imported Maya reference containing your material shading networks.
Then read manekineko_with_mat.usd
back in Maya with a Read USD operation: you
will get back a Compound in the outliner and if you open MEOW you will see its
hierarchy:
Create a light, if you haven't already, and render (note that we have turned on
subdivision surfaces on the Compound of Arnold for a prettier render), you will
see that the asset is renderers using the actual material shading networks that
were assigned to the original Maya geometry, while the Compound shape is set to
lambert1
(or whichever material you might have assigned):
How is this possible?
This is because you are effectively overriding the “node assignment”
(lambert1
) with the “multiverse material” assignment that is written in the
USD files, these are assigned and resolved procedurally at render-time.
You may have already noticed by looking at MEOW that near every shape item you have a gray material icon, that stands for a material assignment written in the USD of this Compound and associated to that particular item.
Also, if you MMB on one of these shape node with the gray icon, you will clearly
see a property called multiverse:material
→ pointing to a string with the
material SG name (e.g. bodySG
):
This means that, as long as a SG named bodySG
exist in Maya, it will be
procedurally assigned at render-time to its relative USD item.
So we can say that:
Multiverse Material Assignment
↓ // (overrides)
Node Assignment
2
3
# Material Overrides assignment in MEOW
In MEOW you can simply RMB on one of your shapes — regardless if that item has a gray icon or not (meaning overrides work regardless of having a multiverse material assignment set in USD) — and create a new material override, by creating a new material or one pre-existing from your scene.
So, let’s override the material on the body by creating a new aiCarpaint
override for that item location:
Multiple overrides at once
You can assign overrides at multiple locations at once, simply perform a multiple selection and RMB> action.
In MEOW, the material icon (which was previously gray because there was a multiverse material assignment coming from the USD file) will now turn to green, because now you are now setting an override that currently exists in Maya (and not in USD).
TIP
If you double-click on the green icon the material will open in the Attribute Editor.
You will see in the next section that you can write this (and any other) overrides to USD and layer it back in your Compound and even write them out as a new composition.
Start a quick render: you will see that the original material for the body (bodySG) is now being overridden by aiCarPaitn1SG:
So we can say that:
MEOW Overrides (in Maya)
↓ // (overrides)
Multiverse Material Assignment
↓ // (overrides)
Node Assignment
2
3
4
5
# Writing Material Overrides
Now that you have some MEOW overrides in Maya, what about if you want to write them to USD?
Comes to play the “Multiverse Write USD Override” operation, which will write overrides for your selected compound to a USD file and will automatically layer it on top of your Compound (there is an option called “auto-sync override after writing” for this, which is ON by default).
Select the root node of Maneki and perform a “Multiverse Write USD Override”
operation using the exact same settings as in the image below, then write the
manekineko_mat_over.usd
file clicking the icon on the shelf:
As a consequence you will see that:
- The
manekineko_mat_over.usd
override has been layered on top in the Compound, to explain it quickly: just like in Photoshop where you can layer pixels, in Multiverse USD you can layer properties/3d-data! - The override will not exist in Maya anymore, it will exist in USD instead, and the icon in MEOW will turn from green to gray again, because now the material is written in USD.
And of course, if you wish, you can still override with a new MEOW override which will update the icon again to green, and repeat this process (write, layer, compose…)
So we can say that:
MEOW Overrides (in Maya)
↓ // (overrides)
Multiverse Material Assignment // (written from previous MEOW Overrides)
↓ // (overrides)
Multiverse Material Assignment
↓ // (overrides)
Shape Node Assignment
2
3
4
5
6
7
# Writing a composition
Finally, as an optional step, we will consolidate our asset by writing out our layered overrides to an actual composition. For this we will use the “Write USD Composition” operation.
Select the root node of Maneki and perform a “Write USD Composition” operation
using the exact same settings as in the image below, then write the
manekineko_comp.usd
file by clicking the icon on the shelf, note that by
default the composition references USD files:
If you render you will get the exact same image of course:
Note
A composition can be made with any number of Multiverse Compounds (containing any number of layers ) and Maya Group (transform) nodes, organized in a hierarchy: this is how you assemble a scene such as our awesome “Esper” scene (opens new window).
# Conclusion
This guide mostly covered material assignment, but there is much more that you can override, write and compose, such as for example attributes, transforms, visibility!
Multiverse offers an unique and powerful way to handle complexity in Maya and yet allow you a full range of overrides and efficient procedural rendering.
Hopefully, now you have become a master at overriding materials in Multiverse! If you wish to be a grand-master, read the advanced section below.
# Advanced: Sparse writing
When we were in step 2a — for simplicity and because it was not the key subject
for this tutorial — we re-wrote an entire new asset, manekineko_with_mat.usd
,
containing all the 3d data plus the multiverse material assignment, but, in
principle, we already had the whole 3D data written before, in manekineko.usd
.
So, what would have been a more interesting workflow that could also suit multi-department productions (such as a studio where modeling and look-development are two well separated tasks)?
With Multiverse we can write the material assignment informations as “sparse data”, which we can then “layer” on top of the original data.
To do this use the following options and write the USD Asset
maneki_sparse_mat.usd
:
Then we simply layer maneki_sparse_mat.usd
on top of maneki.usd
in our
Compound (using the add layer icon for example), and we could have also layered
our maneki_mat_over.usd
with additional material override:
Note
Layering maneki.usd
with maneki_sparse_mat.usd
and maneki_mat_over.usd
will compose the two layers and the result is exactly equivalent to maneki_comp.usd
.