Saturday, February 20, 2010

Animating Hidden Keyable Attributes

When taught to animate in Maya, we tend to become very comfortable with the channelBox, but the channelBox only offers a small portion of all the attributes we are able to animate. The keyable attributes you see in the channelBox are usually only the most common ones available to you. In this tutorial, I will describe how to locate, setup, and animate the color attribute on an object that has a Phong shader connected to it. After acquiring this knowledge, I encourage you to experiment with other keyable attributes. In a later edition, I will show you how to animate non-keyable attributes.

Let's start out by creating a simple NURBS sphere on the stage and by pressing 5 on your keyboard so you can see the sphere shaded gray. What you see is a default Lambert material that is assigned to NURBS objects at creation. Let's right click the sphere and assign a new Phong material to it. Open your Attribute Editor by pressing Ctrl+a and find the phong1 tab. Make sure your playhead is on frame 1 because we're about to key a color. Locate your color attribute in the Attribute Editor under the phong1 tab. Right click it, then click on Set Key.

At this point, it appears nothing has happened. There is no red tick on the timeline and Maya did not alert you of a change. If you look to the right of the color slider, the checkered box turned into the input symbol. If you click it, you'll see that the color attribute is now an input to an animation curve!

After clicking the input symbol, you should be on the phong1_colorR tab of the phong1 Attribute. Under the Keys section is a charted version of the keys you set on this curve. This isn't too user friendly so let's bring this up in our Graph Editor. Wait a second? We need to be able to select this object before the Graph Editor can load it... that means we'll need to open up our Hypergraph so we can find and select the object.

Select the sphere you created and go to Window:Hypergraph:Connections. Find and select the phong1SG (read: phong shader group.) Let's graph the input connections by navigating to Graph:Input Connections. Viola! You are now looking at phong1_colorR, phong1_colorG, and phong1_colorB. You can select them and they will appear in your Graph Editor. You are now able to modify the curve as you see fit and best of all, since it's a color that you're animating, you get an instant preview in your viewport.

To finish the exercise, hold k+LMB and click on frame 24 inside the GE. Hold i+MMB to insert a key. Now press w, select the key you just created and move it up to give it a value of 10. You have just created a glowing light. Select Curves:Post Infinity:Cycle to give it a pulsating effect.

I hope you have found this tutorial useful. Please experiment with this technique and share your experiences.

No comments:

Post a Comment