Introduction -PRimitive Variables |
In
this tutorial you will see a basic example of how to use Primitive Variables in
MTOR. This
scene used a Primitive Variable called "mycolor" to drive the color of
a constant shader on a sphere. 1- First, open Maya and make new scene First
open Maya and in a new scene create a simple sphere. Or to see a finished scene,
open the tutorial file: 2- Add attribute Using
the Attribute Editor you can select the tab for the shape node on the sphere and
click the "Select" button at the bottom of the Attribute Editor tab
for the shape node.
When naming your variable, be sure that the name doesn't terminate with the string "Cache" or the number '0'. Maya automatically creates variants of your data by storing cached and preroll versions of your data. So if your data is named rmanFmyS, Maya may create rmanFmyS0 and rmanFmySCache. MTOR ignores variables whose names obey this convention. You will notice that three new attributes have been created on the shape node for your sphere (one each for X, Y, and Z). In this case we will be using these to control R, G & B in our shader. ![]() 3- Create a shading network to read variable The next step is to create a slim shading network. 4- Attach shader and set color Now that we have the shading network completed all we have to do is attach
the shader to the sphere and set the color via the attribute added to the shape
node in Maya. 5- Render Here's our resulting image:
|
Pixar Animation Studios
|