Maya Connections by Jamie McCarter
Maya Connections by Jamie McCarter
MAYA CONNECTIONS
Tutorial by Jamie McCarter jamiem@ice.org http://www.jamiemccarter.com/
Converted to ASCII text by RaD Man of ACiD Productions www.acid.org
HTML version available at http://www.ice.org/tutorials.php?tutorial10
kz
Start Maya.
One of the great strengths of Maya is its flowchart network of nodes and
the ability to connect attributes from node to node. A fairly simple idea,
but in execution very powerful. A vast majority of my time rigging
characters is spent in the hypergraph making connections expressions pay
a large role as well, though that will have to wait until a future
tutorial. In this tutorial Ill be touching on the hypergraph and the
strength of connections.
hypergraph.gif A spider web of connections that comprises just a small
bit of a larger character rig. Our network wont look anywhere near so
complicated. No worries.
Lets begin by supposing we want to create a sphere that rests on the origin
and as the sphere increases in size, it remains resting on the origin. OK,
perhaps not the most flash tutorial, but itll get you familiar with making
connections between seemingly unrelated attributes. And then well move
onto some cooler stuff.
constructionhistory.gif Ensure that construction history is enabled.
Create a nurbs plane Create NURBS Primitive Plane and a nurbs sphere
Create NURBS Primitive Sphere. Unfortunately, our plane is bisecting
the sphere. Wed prefer the sphere to rest on the plane. We could simply
translate the sphere up in Y and have done with it. However weve also
stated that we want the sphere to always remain resting on the ground plane
as it changes in size. In order to achieve this wed have to
simultaneously adjust the translateY and the radius of the makeSphere node.
And if we were animating the sphere wed have to ensure the animation
curves for both the radius and the translateY were identical. Sounds
fairly arduous to me.
This is where the connectivity of the hypergraph comes in handy. Two
solutions to our problem are readily apparent. We can either key
translateY and then use the same animation curve to drive the radius of the
sphere. Or we can drive the radius of the sphere with the translateY.
step00.jpg
step01.gif I much prefer the idea of connecting the translateY of the
sphere to the radius of the makeSphere node. This will give us the ability
to interactively move the sphere and see the sphere increase in size. If
we were to connect the animation curve of translateY, first wed have to
have the translate keyed, and secondly when we went to position the sphere
we wouldnt see the sphere increase until after keying.
So lets connect the translateY to the radius!
Open the Connection Editor Window General Editors Connection Editors.
Now select the nurbs sphere and click the Reload button on the Outputs
side of the connection editor. In the channel box click under the
INPUTS section where the makeNurbsSphere node is. This doesnt
actually select the node, but for windows such as the connection editor,
its enough of a selection. Click Reload on the Inputs side.
Youll notice that both the makeNurbsSphere and the nurbs sphere transform
are loaded. Well just ignore the latter and focus on the makeNurbsSphere
node.
Open up the Translate section on the Outputs side and select
translateY. Now select radius on the Inputs side. If you dont have
Auto-Connect activated you may need to click the Make button. But
typically the connection should be made for you automatically.
First thing youll notice is that the sphere disappears. No worries. This
is simply because we have directly connected the translateY of the sphere
to its radius. And as the sphere is sitting at the origin, the translateY
is 0. Consequently so is the radius. Select the sphere in the outliner,
move it up and down and youll see the sphere appear and adjust in size.
So what is going on here? As the diagram below illustrates, the translateY
of the sphere flows from the transform node to the makeNurbsSphere. Thus
continuously updating the radius to be equal to the translateY. And the
makeNurbsSphere outputs the sphere data to our shape node, creating a
fabulous re-sizing sphere. Hazzah!
sphereconnections.gif
But, you may say, Why didnt we just move the pivot of the sphere to the
base of the sphere? Then when we scaled the sphere it would scale about
the point resting on the ground plane. Quite true. And perhaps that
would be a solution, but if you then attempt to rotate your sphere, it
would rotate about the pivot resting on the ground and not the center of
the sphere. Depends what effect you are going for. With Maya there is
usually at least two ways of arriving at the same location.
shading00.gif Alright, so that achieved lets do a bit of shading on our
sphere. Its going to get a bit more complicated now, so hang on. The
effect Id like is one of polished glass with the appearance of lighting
casting through the volume and reflecting off the back surface. And, as
Ive got a slow computer and a tight deadline Id like to use only one
light source and no raytracing.
Windows View Arrangement Two Panes Stacked. In the upper pane make
sure its the persp view. Panel Perspective persp and smooth shading
is on Shading Smooth Shade All. In the bottom pane, the hypergraph
Panel Panels Hypergraph. Bring up the create render node window
Rendering Create Render Node... and ensure With Shading Group is
activated. Now click Surface Shader. In the hypergraph appears a
surfaceShader node connected into a shading engine. Select the
surfaceShader probably named surfaceShader1 and middle-click drag it
over the sphere in the persp window. Release. The sphere now turns a
horrible green. Ahh well. Thats the default openGL shading appearance
of the surfaceShader. It will render somewhat differently.
Create a point lightsource Create Lights Point Light and place it
above and slightly to the right of our sphere. Now were almost ready to
render.
Before we begin rendering, lets change out background colour to something
other than black so that we can easily see the sphere.
View Camera Attribute Editor brings up the persp attributes. Open the
Environment tab and set the Background Color to a colour of your
choosing. I chose Red 0.161, Green 0.333, Blue 0.510 to match this
website. You might want to choose a neutral grey.
Now change the persp panel to a render view
Panel Panels Render View. And render an interactive render
IPR IPR Render persp. The sphere appears, but black and
uninteresting. No worries. Click drag a render region around the sphere.
IPR will now update these pixels while we modify our shading network.
Were going to need some more rendering nodes. Create an anisotropic
shader without a Shading Group, an rgbToHsv utility node and a ramp
texture without New Texture Placement and as Normal - not projection or
stencil.
Connect the ramps .outColor to the surfaceShaders .outColor. You can do
it through the connection editor if you like. However if you middle-click
drag the ramp over the surfaceShader node it should connect automatically.
Certain default connections work this simply. In the render view youll
see our surface textured with the ramp. Sweet.
shading01.gif
By default the anisotropic shader comes in with a color of 0.5, 0.5, 0.5.
Pull that down to black. Also take Diffuse down to 0.0. Were going to
use the anisotropic shader just for its specular highlight and dont need
these. Now middle-click drag the anisotropic node to the rgbToHsv node.
The connection editor should appear with the two objects loaded. Connect
.outColor from the anisotropic node to the .inRGB attribute of the
rgbToHsv. This takes the anisotropic highlight computed in the anisotropic
node and by passing it through the rgbToHsv we convert the colour to
separate components of Hue, Saturation and Value. Were interested only in
Value in this tutorial.
shading02.gif
Connect the .outHsvV to your ramps .vCoord. Voila! Instead of taking the
UV coordinates from the surface were now driving the coordinates of the
ramp with the intensity of the anisotropic highlight. Change the colours to
better suit your mood. Notice how you can have a nice white highlight and
tone it down to a blue with a very subtle purple at the dark depths. Very
nice.
Alright, now that youre getting up to speed Ill leave the rest of the
tutorial up to you. The shading on the left of my sphere was done with a
samplerInfo node piped into both a multiplyDivide and an animation curve.
Those both then piped into a diffuse shader. Ill give you a hint: play
around with what happens if you multiply normals...
Good luck!