|
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 ControlsAt 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 controlsLet'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 menuThe 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 KeyframesWhen 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 SliderSo how do we create a keyframe? There are a number of ways to do this in Maya; here are the most common ones:
The Graph EditorSetting 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 EditorLet'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:
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.
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 EditorDope SheetThe 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 SheetNOTE 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. PlayblastDepending 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.
Figure 16.10. Playblast optionsAs 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. |
|