# Material Assignment with Namespace

This guide covers material assignments with namespace: you will learn how to setup a material "library" coming from a Maya reference and hook it up with an asset.

# Read the asset

Let's start by reading our dear friend, the Croc. It’s a static T-pose asset that we layer with animation as shown below:

If we inspect it from the MEOW we should see that the asset has been written with material assignment (gray icon). So, let’s render this to see the results:


# Reference the Materials

It still renders with the default material (lambert1) because even though there are already material assignments, the actual material (shading networks) are not present in this scene. We need to Maya-reference he material library for this asset croc_ldv_mat.ma which contains the materials for the Croc, as you should know the reference will come into Maya with a namespace.

# Set the namespace

It's time to create an attribute override on the root of the asset in MEOW, this create an mvSet node and assigns it to the root location of the Croc (this way we will rely on the inheritance to all its children as long as they are not overridden at child level):

When we inspect the newly created mvSet1 we will see an "enable namespace" and a namespace string parameter: here we set material namespace as croc_ldv_mat since that is the reference name of our material library.

When we render, we should see the materials have been applied successfully.

# How to Create a Material Library in Maya

Here’s how to create material library in Maya. For example we are in a Look Development scene and we have finished tweaking the looks of the asset. In order to export the material library we can use Maya’s Hypershade to do that.

First from Hypershade it’s better to categorize the Shading Groups that we use for our asset. It is best practice to do so. This to avoid exporting unwanted materials that are not contributing with the asset. We can use Hypershade’s "Bins" to do that.

After that all we need to do is just select all the Shading Groups in the active Bin and use File > Export Selected Network to a file of our choosing.

From here we can create as many material variations for the same assets and using the material namespace explained above we should be able to switch materials without even having duplicated assets with different materials as we did in the old Maya ways.

Note

Please make sure to keep the same Shading Group names if we want the material library to be consistent. Please read Material Assignment to understand the various material assignments and their override order.

Last Updated: 1/5/2021, 6:45:19 PM