Animation Tools


There are many ways to produce and control animation in Maya (in fact, whole books are written about them), so we'll just look at the main animation controls.

Animation Controls

At the bottom of the Maya user interface are various animation controls; these can be seen in Figure 16.2.

Figure 16.2. Maya's animation controls


Let's first look at the Time Slider. This bar shows the range of frames you are currently working on. Clicking anywhere in here with the left mouse button will highlight the selected frame with a black box and update the view to show that frame of the animation.

TIP

Clicking with the middle mouse button in the Time Slider will select that frame but not update the time in the views. This is handy if you want to quickly copy the pose from one frame to another. You simply select the object whose keys you want to copy, select the frame you wish to copy to with the middle mouse button, and then set a key on the object at this new frame.


Right-clicking on the Time Slider will open up a new contextual menu (Figure 16.3). These options allow you to cut, copy, and paste selected keys, snap them to specific times, and adjust the playback and range of the animation. We'll look at other contextual menu items (such as Tangents and Playblast, which play a valuable role in animation) later in the chapter.

Figure 16.3. The Time Slider contextual menu


The Range Slider sets the current visible range in the Time Slider. This is useful if you need to work on a specific section of the animation, while also maintaining the full animation timeline.

Setting values for the Animation Start Time and Animation End Time will set the overall animation's timeline.

You can use the Playback Start Time and Playback End Time to manually set the Range Slider. To interactively edit the Range Slider, use the Range Slider bar. At either end of this bar are two small squares; click and drag these to specify the Time Slider range in which you want to work.

The Playback Controls are very much like a remote control, allowing you to play the animation, step along a frame at a time, or even move along to the next keyframe.

Now that we know how to control time in Maya, let's now look at how to set keyframes.

Setting Keyframes

When you set a keyframe, you are actively storing that object's attribute values at that specific time. Storing particular values at specific spots in the Time Slider instructs Maya to create the in-between positions of those values that ultimately provides the illusion of movement.

NOTE

Although they are related, setting a key is not the same as setting a driven key. As you may remember from Chapter 12, driven keys link one attribute to another, but are set at specific attribute values, not specific frames in the Time Slider. Ordinary keys are set at a specific frame, storing the currently selected attributes at that time.


When keys are set on an object, they show up in the Time Slider as red lines (Figure 16.4, top). You can then interactively edit these keys, moving and scaling them in the Time Slider itself. To do this, hold down Shift and drag over a selection in the Time Slider. Your selection will be marked with a red box, with arrows at either end and in the center (Figure 16.4, bottom). Selecting the center arrow lets you drag the selection, in effect moving the entire set of selected keys as a group. Selecting and moving one of the end arrows lets you scale the selected keys in that direction.

Figure 16.4. Working with keys in the Time Slider


So how do we create a keyframe? There are a number of ways to do this in Maya; here are the most common ones:

  • In the Animation menu set, go to Animate > Set Key (you can also access this tool by pressing S). By default this will set a key on all the selected object's keyable attributes, but it can be configured to work however you like, using the options seen in Figure 16.5. The best thing to do is play around with this tool until you find a setup that works best for you.

    Figure 16.5. The Set Key options


  • In the Channel Box, simply right-click on a single attribute and choose Key Selected to set a single key. Key All will set a key on all the keyable attributes of the object.

  • Moving away from the main Maya UI, you can also set keys in several other windows. For example, in the Attribute Editor you can right-click on an attribute and select Set Key.

  • You can also add keys to objects in the Graph Editor and Dope Sheet, both of which are discussed next.

The Graph Editor

Setting keys to move an object is only half the job; the other half is working with animation curves.

To get from one keyframe to another, a curve is drawn between them, sort of like a path to be followed by the object's attributes. This is called interpolation, and it's Maya's way of predicting how the object should move from one keyframe to another. The Graph Editor allows you to edit not only the keys themselves, but also these curves. The tangents of a curve dictate the way the curve enters and exits a keyframe. Editing these tangents can have dramatic results on how the animation flows from one keyframe to the next.

Open up the file Cube_Example.mb. All of these cubes are identical and have exactly the same keys set on them at the same times; but when you play the animation, each one moves differently. This is because each cube's tangents are different.

Open the Graph Editor by going to Window > Animation Editors > Graph Editor. You'll see the window in Figure 16.6. (Your Graph Editor window may differ slightly, depending on the version of Maya you are using. All the basic tools will still be present, however.)

Figure 16.6. The Graph Editor


Let's have a quick look at some of the tools on the Graph Editor's toolbar.

The first few buttons at the left end of the toolbar are the key manipulation tools:

  • Move Nearest Picked Key. When this tool is active, only the key nearest to the cursor will move regardless of how many keys you select in the Graph Editor.

  • Insert Keys. With this tool active, simply select the curve with the left mouse button, then click and drag with the middle mouse button until you reach the place where you want to insert a key.

  • Add Keys. This tool works similarly to Insert Keys, except that clicking with the middle mouse button will dictate where the new key is placed. Holding the middle button allows you to move the key around; it will not be committed to the curve until you release the button.

NOTE

There is an important difference between the Insert Keys and Add Keys tools: Insert Keys will add keys at the position in time that you designate, but only on the existing value curve. Add Keys will add a key wherever you designate, but will not preserve the value curve.


Next on the toolbar are the two Stats input boxes. The first box shows you the frame number of the selected key, and the other box shows the key's attribute value. With a key selected, you can type absolute values into these input boxes to place the key in an exact place or time.

The five Tangent buttons are (left to right) Spline, Clamped, Linear, Flat, and Stepped. Clicking on these will apply a particular tangent to the whole curve or to the selected keys. Tangents are discussed in a later section.

After the tangent buttons are two Buffer Curve buttons. The first one allows you to store the current curve in a buffer. You can then make changes, enable View > Show Buffer Curves to display the buffered curve in gray, and compare the new curve with the buffered curve. If you want to revert back to the stored curve, click on the second button, Swap Buffer Curve.

Next on the toolbar are two tangent-editing tools. The first, Break Tangents, lets you edit the in and out tangents for each key individually. The Unify Tangents button will fix this break, so if you manipulate the in tangent of a curve, the out tangent will also be affected. All tangents are unified by default.

Next to the two tangent-editing buttons are the Free Tangent Weight and Lock Tangent Weight buttons. By default, all curves are created nonweighted; this means you can only edit the tangents verticallythe handles will only move up and down, pivoted around the key. When the tangents are weighted, you have complete freedom over where the handles can be placed; that means you can move them horizontally as well as vertically, adding more weight to each key. To convert a nonweighted curve to a weighted one, select the attribute in the list on the left in the Graph Editor and go to Curves > Weighted Tangents.

NOTE

If you prefer, you can change your general animation preferences to make weighted tangents the default rather than nonweighted.


Now that we have an understanding of some of the Graph Editor's tools, let's get some exposure to working with animation curves and tangents. You should still have Cube_Example.mb open, along with the Graph Editor.

1.

In Maya's main view, select the first cube, named Cube_Spline.

Figure 16.7a shows the Graph Editor with the selected cube listed on the left. Below this is a list of all the cube's attributes that have animation applied to them. Currently only the Translate Z attribute has animation applied.

Figure 16.7. Spline, Clamp, Linear, Flat, and Stepped tangents


2.

Press F in the Graph Editor's main window to frame the animation curve. As you can see, this first cube has a Spline Tangent applied to it. This makes the curve flow smoothly between all the keys.

3.

Select the next cube, Cube_Clamped. This tangent is a hybrid of two others, the Linear and Spline tangents. Unless two keys are similar in value, all the tangents will be set to splines. As you can see in Figure 16.7b, the first two keys have the same value, so their tangents are set to Linear; the third key has a higher value, so the tangents leading out of the previous key and into this are set to Spline.

4.

Next, look at the cube called Cube_Linear. This type of tangent creates a simple linear path between keys (Figure 16.7c).

5.

Now select Cube_Flat. As you can see in Figure 16.7d, instead of the cube following a straight linear path from key to key, it now moves along to the second key and then eases out of it before easing into the final key. This creates a gradual smooth motion when the object starts to move or comes to a stop.

6.

Finally, look at the Stepped tangent shown in Figure 16.7e; this is applied to Cube_Stepped. Unlike the others, this one does not flow along a path as such; rather, it will snap from key to key without being interpolated.

Each of these tangents discussed here can be applied to any curve, by either clicking on the tangent's button found on the Graph Editor toolbar, or from the Tangents menu in either the Graph Editor or the Time Slider contextual menu.

As well as altering the tangents on a whole curve, you can also select each key and apply them individually. With a key selected in the Graph Editor, you can also edit the curves manually using the two handles that appear. These can be moved around until you achieve the motion you require (Figure 16.8).

Figure 16.8. Editing tangents manually in the Graph Editor


Dope Sheet

The Dope Sheet is used primarily to edit the timing of your animation because it gives you access to the keys for the whole scene. This can be very useful when you need to quickly speed up or slow down areas of your work.

To open the Dope Sheet, go to Window > Animation Editors > Dope Sheet. In Figure 16.9, top, we have the window displaying the basic scene summary, which shows us all the keys that exist in the scene.

Figure 16.9. The Dope Sheet


NOTE

This display option is not available by default. To make the scene summary visible, go to the Dope Sheet's View menu and enable Scene Summary.


As you can see, the toolbar is a cut-down version of the Graph Editor's, allowing you to add/insert new keys and input absolute values for existing keys. Next to the Stats boxes is a new button for turning hierarchy on and off. When this is enabled, the keys are displayed on objects that exist below the active object, meaning you can work on an entire hierarchy at once.

You can also display each separate attribute in the scene by clicking on the plus icon next to Scene Summary, which will open up its contents (Figure 16.9, bottom). You can then select the keys, represented by black blocks; the blocks turn yellow when selected. You are then free to move or even scale them using the middle mouse button to achieve the animation you require.

Playblast

Depending on the specifications of the computer you are working on and the complexity of your scene, it can be difficult to get a realistic idea of how your animation is going to flow when put into the game. Producing a playblast allows you to quickly output your animation as a movie, play it back, and see how the animation will look when run at an exact frame rate.

To produce a playblast, right-click on the Time Slider and select Playblast from the contextual menu. Maya will then run through the animation, taking screen grabs of the selected view, and storing them either as a movie file or separate images.

If you open the Playblast options (Figure 16.10), you can configure what Maya will capture and how it is stored. Most of the options are fairly self-explanatory, so let's just have a brief look at the less obvious ones.

  • View automatically opens the movie for you after Maya has finished capturing it.

  • Having Show Ornaments enabled keeps the camera name, axis, and other onscreen displays visible in the playblast.

  • The Viewer options let you specify how you would like the playblast to be output. The Movieplayer viewer will use your operating system's default movie-viewing software, and will more than likely output the playblast as a single movie file. Fcheck is Maya's own viewer and can only handle images. Thus, the playblast is output as individual framesbut this can produce a better, cleaner playback of your animation.

Figure 16.10. Playblast options


As you begin to animate later in the chapter, don't be afraid to generate any number of playblasts; they are an invaluable means of making sure your animation is headed in the right direction.



    Game Character Development with Maya
    Game Character Development with Maya
    ISBN: 073571438X
    EAN: 2147483647
    Year: 2004
    Pages: 169
    Authors: Antony Ward

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net