CHAPTER 9

image

Animation in Maya

 

 

Animation is movement. Ironically, this means that a book on animation can present some interesting challenges. It’s tough in the staid and static form of any book to show movement. There are some great examples of people breaking down movement through series of drawings (see Preston Blair’s, Richard William’s, Frank Thomas’s, and Ollie Johnston’s books); but sometimes the best way to see how to animate is to see it in action — which we obviously can’t do here.

To further complicate things — and the reason I love animation — is that one can almost always get better at it. Every time I see some of my own animated work long after I’ve completed it, I’m a little mortified by what I’d produced. As I animate, I continually learn and get better. This means you’ve never really learned “to animate.” True, you can learn to make things move, but ultimately, learning to animate is never a completed task.

It is within these restrictions that we begin this chapter with the disclaimer that the focus here is not going to be on the principles of animation, but the tools of animation that Maya provides. Now, within this scope, we will be talking about when to use which tools — which will necessitate discussion of animation situations and principles, but the focus is really on Maya.

This brings up one of the real fallacies of 3D animation. People think that if they know the tools, they know how to animate. This is very far from the truth and is akin to saying, “I know how to hold the paint brush — I can paint the Mona Lisa!” Learning the tools is necessary to start your animation masterpiece — but they don’t animate for you, and don’t create good animation by default. Getting the movement you want will evolve when the art of animation is realized through the technology we are covering in this book. The art part, well, that’s up to you.

How Does Animation Work?

Walt Disney may have been a major influence on the original design of Mickey Mouse, but he never animated it. All the early animations of the new star Mickey Mouse (whom Disney originally wanted to name “Mortimer”) were done by his longtime creative partner Ub Iwerks.

Iwerks was a master at the rubber-hose-like animation of the early ’20s and ’30s. Indeed, his work in the young industry of animation was frequently copied and widely admired. Of special importance was that Iwerks was fast and he could draw lots of frames quickly. This is important as what animation really is is a collection of still images — each slightly different from the last, that when played rapidly (as in 24 drawings per second) gives the illusion of movement. This means that just a few seconds of animation is literally hundreds of drawings. Iwerks could draw hundreds of drawings quickly, but as a founding member of Disney Studios — he was also a part owner, and expensive.

As the Mickey Mouse shorts — starting with Steamboat Willie in 1928 — began to take off and rise in popularity, Disney came to Iwerks with a proposition. Most studios were working in an assembly-line sort of way in which the Master Animator (the senior animator) would draw the most important frames — the keyframes — and then pass off the shot to cheaper, younger, and less-experienced animators to draw the frames in between these keyframes. This meant that the majority of the frames were drawn by those with the least experience — but it also meant that most of the frames were drawn by the cheapest work force.

This is how animation in 3D works. You are the Master Animator and you define the keyframes that define a movement. Then, the computer — the cheap workforce — fills in all the frames in between. Like its real-life counterpart, this means that the least-qualified animator — the computer — is drawing the most frames; but the Master Animator — you — can go back in and add additional keyframes to help the computer better understand how to animate the stuff in between.

By the way, Iwerks did not take well to this suggestion and left Disney Studios not too long after this (although there were other issues besides this). The junior animators who ended up drawing most of the frames became known as “in-betweeners” or “betweeners” or even just “tweeners.” This is actually still how this industry works today, although most of the in-betweening usually takes place in China or Korea.

Tutorials to Learn Maya’s Animation Tools

In this chapter, we are going to approach animation in three tutorials. The goal of these tutorials is to learn many (although not all) of the tools that Maya provides to create good animation.

The first tutorial will be the classic hopping ball. Through this tutorial, we’ll learn how to create keyframes and the start of an important tool called the Graph Editor. In the second tutorial, we will look at the Wave/Whip Principle and how it can be facilitated through the Dope Sheet. Finally, we’ll start putting it all together into the final tutorial in which we’ll animate the alien in a walk cycle.

Tutorial 9.1: Animating a Bouncing Ball

I’ve had several students go to interviews with a studio, and the studio — after the interview — performs a brief skills test. The test was, “So, you’re tool is Maya? Ok, cool. Over there on that machine is Maya. Please animate a nicely bouncing ball. We’ll be back in 10 minutes to see how you’re doing.”

The reason for this is simple. There are a lot of important animation principles going on with a bouncing ball — most critically, the idea of Squash & Stretch. It’s the veritable flour sack (the movement test of many early 2D animators) of 3D animation. So let’s see what we can do.

Step 1: Create a new scene and in this scene create a polygon plane for the ground and a polygon sphere for the ball (Fig. 9.1).

image

FIG 9.1 Sphere and plane.

Step 2: Move the axis to the bottom of the ball. In the side View Panel, select the sphere and the hold d and then v down (d to move the object’s axis and v to snap to a vertex), and move the axis of the sphere to the very bottom of the ball.

Why?

The default manipulator is in the middle of the sphere, which means that when the sphere squashes the bottom of the sphere would lift off the ground (it will scale from the middle of the sphere). What needs to happen is that the sphere should squash from the bottom of the sphere (where the sphere will contact the ground), so we need to move the sphere’s axis there.

Step 3: Snap the sphere to sit right on the ground. In the side View Panel, hold x (snap to grid) and move the sphere up so that it’s sitting right on the plane (Fig. 9.2).

image

FIG 9.2 Moved sphere with appropriate axis.

Why?

Sometimes, close is good. But when animating something walking or hopping, “close” isn’t good enough. That ball needs to really hit the ground — not pass through it, not float above it — but be right on the ground. The same would go for feet if the character was walking. This is where snapping to grid or vertices becomes very valuable.

Step 4: Freeze transformations. Select the sphere and choose Modify > Freeze Transformations.

Why?

We’ve moved the sphere from where it was first created. This means that it has dirty transforms (likely Translate Y = 1). This means that to get the sphere back on the ground, we need to get Translate Y to exactly 1 (and remember that this happens to be the value for this situation). A more intuitive method is to just have the sphere be a Y = 0 when it is on the ground. By freezing the transformations, we tell the sphere to make this position its origin. After this, if we ever want to be sure that the sphere is on the ground, we can just enter 0 in the Channel Box for its Translate Y.

Step 5: Set the Animation preferences. Do this by choosing Windows > Settings/Preferences > Preferences. In the left of the Preferences window, look for the Settings section and click on the Time Slider section beneath that. Then, change the Playback Speed to Real-Time (24 fps). Click the Save button to save changes and close the window.

Why?

Maya, by default is a bit of a show off. When an animation is played, it plays every frame as fast as it can. While this might show how great Maya can handle information, it’s useless for animators attempting to find timing. By changing this Playback Speed to Real-Time, Maya will play the frames back at 24 frames per second. If it can play it back faster than that — it’ll restrain itself and still only show 24 fps.

Of course, the bad part of this is that if the scene is too complicated for Maya to playback at 24 fps, it will start dropping frames to keep the playback speed. Luckily for us, we won’t be working with a scene that is complicated enough for that to be a problem.

Time Slider & Range Slider

There are actually a lot of animation tools to which Maya gives access to the animator. However, it provides a default tool that is surprisingly powerful as part of its default layout.

Figure 9.3 shows a screenshot of Maya’s Time Slider and Range Slider. What you’re seeing there are hash marks that represent individual frames. By default, Maya (in a nod to its cinematic roots) animates at 24 frames per second (24 fps). So the duration of time for which 24 frames are displayed in the Time Slider is one second.

image

FIG 9.3 Time Slider and Range Slider.

The dark box represents the Current Frame Marker. This box can be moved (scrubbed) through the Time Slider and Maya will display the state of things at that particular time. At the right of the Time Slider is an input field that represents which frame this Current Frame Marker is on (and can be changed by altering the text in the input field).

To the right of that are some very DVD-player-esque controls that allow the animation to be played forward or backward, fast forwarded or reversed, and advanced (or reversed) frame by frame or keyframe by keyframe.

Beneath the Time Slider is the Range Slider. What this allows an animator to do is decide how many frames will be displayed in the Time Slider. So notice that by default, the Range Slider has defined that the Time Slider will show between frames 1 and 24, but that there are actually 48 frames currently in this animation. The Range Slider has a dark gray bar with numbers and boxes on either side. By dragging the boxes on either end of that slider the frames visible in the Time Slider can be increased or decreased. Similarly, the input fields on both sides of the slider allow for the total frames (far left and far right values) to be changed or the actual frames displayed (inside left and right values).

Importantly, whenever an object has a keyframe assigned to it, when it is selected, a little red line will appear in the Time Slider. However, the Time Slider will only display keyframes for the selected object(s).

Setting Keyframes

When an object is selected, there are several ways to set a keyframe for that object. The most basic way is to hit s on the keyboard. The good thing about this method is that it blankets all the assets and sets keyframes for everything that is keyable. By default, this means there is a keyframe set for Translate X, Y, Z; Rotate X, Y, Z; Scale X, Y, Z; and Visibility — 10 keys (all represented in the Channel Box).

But keys can also be set for individual attributes. Shift-w will set keys for Translate X, Y, and Z. Shift-e sets keys for Rotate X, Y, and Z. Shift-r sets keys for Scale X, Y, and Z. Additionally, in the Channel Box, any channel can be assigned a key by right-clicking it and choosing Key Selected.

There is a time and place for all these methods. For our basic work today, we will be just hitting s.

One final note about where to set keyframes. Tutorials have this illusion of creation as a linear process. The author says to move to a certain frame, set a key, move to the next specific frame, and set a key. In reality, animation is a very circular process. Setting a key is really a guess as to how long it will take to make a particular motion. As you animate more and more, your initial guesses will get better and better — and there are some general guidelines for timing (march time for walks for instance), but remember that the timing of any and all these keys are subject to change. You can and should adjust where these keys are to refine any and all motion into something of use.

Step 6: Set a keyframe at frame 1 for the sphere. Do this by selecting the sphere and hitting s.

Why?

It seems like nothing happens, but if you look at the Time Slider, there will be a red line on frame 1 (assuming that the Current Time Marker is at frame 1) indicating that this is a keyframe.

This first keyframe is important as it lets Maya know “this is where the animation should start, and the shape of the sphere before it starts deforming.”

Step 7: Animate the squash with a keyframe at frame 8. To do this, first move the Current Time Marker to frame 8. Then, with the Scale Tool, first scale the sphere down in Y only by dragging on the green cube handle. Then, scale the sphere up in all directions by dragging on the middle light blue cube. Finally, be sure and hit s to set the key (Fig. 9.4).

image

FIG 9.4 Setting the squash (with consideration for Conservation of Volume).

Why?

To make a ball believably hop on its own accord, we must take hints from how a person would hop. The first thing a person does when hopping is compress the muscles that will provide the upward thrust — he squashes.

But it’s not enough just to make the sphere get squattier. There is an important concept in animation called “Conservation of Volume,” which focuses on the amount of material that is in an object remaining constant regardless of how it deforms. If this sphere were a balloon and we pressed down on the top, the amount of air within the balloon wouldn’t change, it would just reshape. This means that as the sphere gets shorter in Y, it has to get wider (fatter) in X and Z.

Step 8: Animate the stretch at frame 12. Do this by moving the Current Time Marker to frame 12 and then use the Scale Tool again to scale the sphere tall (with the green cube handle), and then very skinny (with the blue cube handle). Hit s to set the key (Fig. 9.5).

image

FIG 9.5 Setting the stretch keyframe.

Why?

This is the second half of the critical Squash & Stretch principle. As a person jumps, he uncoils those compressed muscles and stretches out to a long pose before lifting off the ground. This explosion of energy happens much faster than the squash (this is happing over four frames here).

Notice that we are also still working with Conservation of Volume. As the sphere gets really tall, he needs to get really skinny.

Step 9: Set the keyframe for the top of the hop. To do this, move the Current Time Marker to frame 24. Use the Move Tool and move the sphere up into the air along the Y axis to where you figure the top of the hop would be (I’m using Y = 8). Then, in the Channel Box, change the Scale X, Y, and Z values to 1. Hit s to set the key (Fig. 9.6).

Why?

One of the advantages of freezing the transformations as we did earlier is that when the ball needs to get back to regular size (Scale), we can just set the Scale X, Y, and Z to 1 in the Channel Box and we’re there.

In other news, in this step, we are both moving and scaling, but hitting s once will set the keys for Scale and Position (and Rotation too, by the way, even though we aren’t changing this).

 

image

FIG 9.6 Ball at the top of the hop.

Step 10: Increase the visible frames to 48. Do this with the Range Slider by dragging the right end of it out to fill the entire 48 frames.

Step 11: Set the keyframe for the landing. To do this, we’ll explore a little bit different method. This keyframe on the landing will look very similar to the keyframe where the sphere leaves the ground (frame 12). Move the Current Time Marker to frame 12 and then right-click-hold on it and choose Copy. Then, move the Current Time Marker to frame 36 and again right-click-hold and choose Paste > Paste (Fig. 9.7).

Why?

This is frequently a problem for students. They know that when the character hits the ground, they squash. The important detail here is that it’s because the character hits the ground that he squashes. This means that the moment the ball touches the ground, it still needs to be stretched. It’ll squash in just a bit.

This method of copy and pasting keyframes can help speed time up and generate some nice consistency across the animation. It turns out that Maya’s copy/paste mechanism is really deep and can be really complex. But for this situation, the standard method shown in step 11 works great.

 

image

FIG 9.7 Setting the key that defines the moment of impact.

Step 12: Copy and paste the squash keyframe to frame 40. Copy the key at frame 8 and paste it into frame 40.

Step 13: Copy and paste the rest key from frame 1 to frame 48.

Step 14: Play the animation. Do this with the VCR looking controllers in the Time Slider or by hitting Alt-v (Alt-v will also stop the playback).

Refining Animation

Well, it’s moving. And it’s got squash and stretch happening. But it’s still a long way from plausible or appealing. This is the nature of animation — at least for me. My first pass is almost always wrong — or at least not right.

This is where the power of the computer as an animation tool starts to emerge. We’re not tied into the choices of timing or position, and in fact, we can change things in a hurry.

Overwriting Keys

The first way we’re going to look at editing animation is to simply write over an existing keyframe. This is pretty easy; just move the Current Time Marker to a frame that already has a key, make changes and when s is hit again, this new key will replace the old one.

Step 15: Make the hop higher. To do this, move the Current Time Marker to frame 24 (the top of the hop). Use the Move Tool to move the sphere higher (say Y = 12). Hit s to overwrite the keyframe.

The Graph Editor

The Graph Editor is an extremely powerful — although not always intuitive — method of adjusting animation. To access it go to Window > Animation Editors > Graph Editor. What this will do is provide a graph of the keyframes assigned to any given object.

For instance, Fig. 9.8 shows the Graph Editor for pSphere1. Along the left side you can see the object selected, and a list of all the attributes that have keyframes (Translate X, Translate Y, etc.). If any of these attributes are clicked, the graph on the right will show only the keyframes for that attribute.

image

FIG 9.8 Graph Editor for first draft of the sphere’s jump.

Keys are represented by black dots within the graph area. These keys can be selected and moved, scaled, or rotated. Maneuvering in this graph space is consistent in Maya. Alt–middle-mouse-drag pans around, Alt–right-mouse-drag zooms in and out. Finally, hitting f on the keyboard will focus the active elements.

The Graph Editor will always show the time (by frames) across the X axis. The Y axis will be values that change depending on what attribute is selected. For instance, if Translate Y is selected, the Y values represent centimeters (the default Maya unit). But, if Rotate Y is selected, the Y values represent degrees.

One key thing that is a little different here is that to move a key either in time (by shifting it along the X axis) or in value (by shifting it along the Y axis) requires you to first be in the Move Tool (hit w on the keyboard) and then middle-mouse-dragging.

Step 16: Make the hop still higher through Graph Editor manipulation. The height of the bounce is defined by the Translate Y values. With the sphere selected, in the Graph Editor, click on the Translate Y in the left side list of attributes (this will show only the keys for Translate Y). Swap to the Move Tool (hit w on the keyboard). Select the key that represents the top of the hop. Hold Shift down and middle-mouse-drag the key up to around Y = 16 (Fig. 9.9).

image

FIG 9.9 Adjusting animation by moving keys in the Graph Editor.

Why?

Holding the Shift key down makes sure you are only moving the Translate Y value and not moving the keyframe in time as well.

Anatomy of a Curve

The Graph Editor is about curves. Being able to read the curves and manipulate those curves is what makes this tool powerful. Consider the following curves (Fig. 9.10).

image

FIG 9.10 Various curves and their meaning.

These curves represent a Translate curve within the Graph Editor. Again, the X axis shows time and the Y axis shows distance. In both the curves, notice that the movement happens over the same amount of time, but the one in the left travels a far shorter distance than that in the right. This means that the graph on the right shows an object traveling much faster. Steeper curves represent faster movement.

Now, to continue on with this, check out the curves in Fig. 9.11.

In these two examples, the two keyframes are in identical locations. The difference is how Maya is interpolating between the two. In both the cases, I’ve split up the time into two equal halves. Notice that in the image on the left, the distance traveled is a lot more over the first half of the time covered than in the second half. This means that this object shoots off in a hurry and then eases to a stop.

image

FIG 9.11 Again, two animation curves as they would appear in the Graph Editor.

Conversely, the image on the right shows a curve in which the distance traveled over the first half of the time covered is very little compared to that traveled over the second half of the time. This is an object that travels very slowly at first and speeds up as it goes.

The funny thing about those two graphs is that the keyframes themselves are identical — it’s all about how that curve goes between the two. Clearly, controlling that curve makes a big difference in the movement of an object.

Bezier Curves, Anchors, and Handles

The Graph Editor allows you to adjust curves in much the same way that tools like Adobe Illustrator do. We’ve looked at Bezier Curves in earlier tutorials, and the core idea here is the same. Each of the keyframes acts as the anchor, and off of that anchor will be two handles that determine how the curve comes in and goes out of that anchor (Fig. 9.12).

image

FIG 9.12 Default tangents of a selected keyframe.

To manipulate tangents, first the keyframe must be selected. When this is done, the keyframe will highlight yellow and the tangents will highlight pink. Now here’s where it gets a little clumsy. By default, the curves that Maya builds in the Graph Editor use Locked, Non-weighted Tangents. What this means is that the tangent handles are the same length for every anchor (non-weighted) and are unable to be lengthened (locked). We want to be able to grab ahold of those tangent handles and bend them in all directions and change their lengths to really have control over how those curves — and thus the motion -work coming in and out of keyframes. Let me show you why (Fig. 9.13).

image

FIG 9.13 The Translate Y curve for our sphere.

Of particular interest are the two highlighted areas at frames 12 and 36. Frame 12 is where the sphere leaves the ground and frame 36 is where it touches down again. Notice that before frame 12 and after frame 36, the line is flat — meaning that the sphere does not move in Y at all (which is what it should be doing). The problem is that at frame 12, the curve is flat going out of the key. And then again, in frame 36, the curve is very flat coming into frame 36. This means that at the frames immediately following lift off (frame 12) -when the sphere has exerted enough force to lift it off the floor (an explosive amount of energy), it is traveling very slowly. Likewise, at frame 36, when the sphere has been falling the farthest, it suddenly — right before hitting the ground — slows down. Both are just plain wrong.

What should be happening is a very sharp vertical curve coming off of frame 12 and a very sharp vertical curve coming into frame 36. To do this, we need to be able to control the tangents — and specifically to break them.

Step 17: Weight the Tangents. To do this, select the sphere and then in the Graph Editor click on the Translate Y attribute. Hit f to frame this curve. Click on the green curve in the graph area. Choose Curves > Weighted Tangents.

Why?

The handles will change a little bit in the Graph Editor. The tangent handles themselves will get slightly larger circles on their ends. But importantly, they will no longer be the same length going in and out of the anchor (take a close look at the tangent handles at frames 12 and 36 for example).

Step 18: Free the Tangent Weights. To do this, with the Translate Y curve still selected, choose Keys > Free Tangent Weight.

Why?

The handles will change in appearance again. The end of the tangent handles will appear as squares. This means that now these handles can be grabbed and shortened or lengthened.

Step 19: Add some extra hang time. At the very top of the hop the sphere’s upward energy is giving way to gravity. This is the point where the speed of the sphere in Y will be the slowest. To help pump this up, we’ll make the curve flatter at the apex. To do this, marquee drag around one of the tangent handles for the key at frame 24 (at the top of the hop). Using the Move Tool, and while holding Shift down, middle-mouse-drag the tangent handle outward (Fig. 9.14).

image

FIG 9.14 Adding hang time by flattening out the curve at the height of the jump.

Why?

So now the curve coming in and out of that key is flat, meaning that the sphere is traveling very slowly through the frames before and after this key.

 

Tips and Tricks

Selecting things in the Graph Editor can be a little tricky. Get used to using the marquee-select (dragging across the curve or key you want to select). It’s different than simply clicking on a curve or key; and for our purposes will actually expose the things we need to adjust.

Step 20: Explode off the ground. Do this by breaking the tangents at frame 12. To make this happen, marquee-select the key at frame 12 (all this is done within the Graph Editor). Then, choose Keys > Break Tangents. Marquee-select the handle on the right and middle-mouse drag it straight up (Fig. 9.15).

image

FIG 9.15 Creating a quick explosion off the ground by breaking the Translate Y tangent and pointing the tangent straight up.

Why?

A unified tangent means that the two handles on either side of the tangent are connected. So when one handle is grabbed, the other side stays straight in line — as though they were two ends of a stick. In this case, we want there to be a clear, sharp break at the key. So breaking the tangents allows us to alter one handle without changing the other. By moving this tangent straight up, the curve going out of the key at frame 12 becomes very sharp, which means that the speed will be very fast; the sphere will be exploding off the ground with enough energy to overcome the force of gravity.

Step 21: Repeat for the key at frame 36 (Fig. 9.16).

image

FIG 9.16 Broken tangent with sharp tangent at landing key.

Why?

The sphere will travel faster the farther it falls (until it reaches terminal velocity). It should be traveling the fastest right before it hits the ground. This means that the Graph Editor’s curve should be the most vertical going into the frame 36. Breaking the tangent and making it vertical does just that.

Step 22: Play the animation. Do this back in the View Panel with the Time Slider. You should see an immediate difference.

Conclusion

Pretty cool, huh? The animation of that sphere should immediately feel more lifelike and like it has real weight. This comes from effective Graph Editor work and knowing what the curve should look like.

In my university classes 7 out of 10 times, the problems with assignments turned in can be solved with further work in the Graph Editor. It can sometimes feel “unartistic” to be mired deep in Graph Editor curves, but an animator who is comfortable in the Graph Editor produces better animation faster and more efficiently. Make the Graph Editor your friend.

Tutorial 9.2: Wagging a Tail

The bouncing ball is a good start and shows some great understanding of concepts like Squash & Stretch and Conservation of Volume. Another key idea of animation is the Wave/Whip Principle-the idea of organic motion happening like a whip.

For instance, consider a dog’s tail. The part of the tail nearest the dog’s body will move first, with each vertebrae of the tail farther away moving slightly later. When each part of the tail is moving just a little later than the part before, the beautiful wave begins to emerge.

Maya provides some very quick ways to get this just right. On the one hand, you could manually go in and set a whole lot of keyframes to get that motion correct. But we can also set a bunch of keyframes en masse and then go back and adjust the timing to get the wave principle to emerge.

To look at this, we’ll create a string of joints that we’ll animate. In this example, we won’t bother skinning the joints to any geometry, but it would work just the same if the joints were actually deforming a mesh.

Step 1: Create a new file.

Step 2: In the top View Panel, create a tail as a string of joints (Fig. 9.17). The exact number and size is unimportant. I’m using 11 joints that I snapped to the grid (holding x down) so they were pretty much in a straight line (although this too is cosmetic).

image

FIG 9.17 Creating the tail with a string of joints.

Step 3: Pose all the joints rotated to one side and set a keyframe for all. Do this by shift selecting each of the joints individually, starting from the tip and moving up to the base. Then, using the Rotate Tool, rotate all of the joints at once (Fig. 9.18). Hit s to set a keyframe for all these selected joints.

image

FIG 9.18 Rotating all the joints 15 degrees to one side.

Why?

By selecting all the joints — one at a time — and rotating them together like this, we know that each of the joints are rotated the same amount. It saves loads of time being able to rotate them all at once — the cumulative effect is a quick curve. This also means that when hitting s to set a keyframe, each of the joints all get their own keyframe—just what we need.

 

Tips and Tricks

You may take note of what the Rotate Y value is in the Channel Box (mine is 15). This will just allow for some nice symmetricality when posing to the other side.

Step 4: Set a keyframe for the joints rotated in the opposite direction. To do this, first move the Current Time Marker to frame 10. While all the joints are still selected either rotate using the Rotate Tool, or simply look at the Channel Box and make the Rotate Y value a positive value (if it was negative). Hit s to set another keyframe for all of these joints (Fig. 9.19).

Why?

Scrubbing between frames 1 and 10 will show the tail moving, but it will look really stiff. Yes, all the joints are rotating over this period, but there is no wave principle happening. We need to fix that.

 

image

FIG 9.19 Rotating the joints in the opposite direction. This can either be done with the Rotate Tool, or by entering a positive value in the Channels Box.

Step 5: Increase the overall length of the animation. Do this in the Range Slider by changing the input field that reads 48 (the overall length of the animation) to 150. Then, use the Range Slider to show all 150 frames by dragging the bar wide so it includes from frames 0 to 150 (Fig. 9.20).

image

FIG 9.20 Adding frames to the length of the animation.

Step 6: Copy and paste the two keys to frame 20. To do this in the Time Slider click on frame 1 and then Shift-drag across to include frame 10 (it will highlight in red). Right-click-hold anywhere in the red area and choose Copy. Click on frame 20 to move the Current Time Marker there, and then right-click-hold and choose Paste > Paste.

Step 7: Paste to frames 40, 60, 80, 100, 120, 140. For each of these frames, click on the frame, then right-click-hold and choose Paste > Paste.

Why?

What’s happening here is that we are copying the pair of frames and pasting them every 20 frames. The net result will be the tail wagging back and forth. Since the pose at frame 20 is the same as at frame 1, when Maya rotates between frames 1 and 10, it will then rotate back to the pose it has at 1 (now pasted to frame 20).

Dope Sheet

Figure 9.21 shows the Graph Editor for the current animation. All of the joints are selected and there is one monolithic green curve (Rotate Y). All the joints are rotating the same amount at the same time.

image

FIG 9.21 The Graph Editor for our current animation. All the joints are moving the same amount at the same time.

To get the wave principle working, we need each joint to do the same rotation, but just a little later than the joint above it in the hierarchy. While this could be done in the Graph Editor — or even in the Time Slider — it would be exceedingly laborious.

But this sort of frame offsetting is perfect for the Dope Sheet. Historically, the Dope Sheet was a planning document used in 2D animation that allowed a director to plan parts of the shot. This could include everything from action-specific notes to camera movement ideas.

In Maya, the Dope Sheet (Fig. 9.22) is accessible via Window > Animation Editors > Dope Sheet. It is also a sort of visual spread sheet but is more about timing than values. It shows what keyframes are on what object at what time — but doesn’t provide much in terms of values of those keys.

image

FIG 9.22 The Dope Sheet.

I like to use the Dope Sheet to offset keyframes. When moving keyframes in time, the Dope Sheet automatically snaps to a frame (so you don’t end up with a keyframe at frame 12.462), and it provides a more condensed way to access collections of keys than the Graph Editor does.

Again, maneuvering within this space is the same: Alt-middle-mouse-drag pans across the time while Alt-right-mouse-drag zooms in and out. Selecting keys in this view also works best by marquee-selecting them, and actually manipulating them (like moving them) uses the middle-mouse-drag mechanism.

Step 8: Offset all the keyframes for joint2 and down by one frame. Do this in the Dope Sheet by first zooming out to see all the keys. Marquee around all the keys for joints joint2–joint11. Activate the Move Tool (hit w) and middle-mouse-drag the keys one frame to the right (Fig. 9.23).

image

FIG 9.23 Offsetting keys by one frame.

Step 9: Repeat, but this time select the keys for joints3-joint11 (Fig. 9.24).

image

FIG 9.24 Again offsetting keys, but this time from joint3 to joint 11.

Step 10: Repeat all the way down the chain; each time leaving off one more joint and each time sliding the keys down one frame (Fig. 9.25).

image

FIG 9.25 All the joints’ keys offset.

Why?

So the results here are all the same animations happening, but each joint’s animation is happening one frame later than the joint above it. This makes quick work of adjusting a lot of keyframes.

Step 11: Play the animation. There should be a sexy looking wagging tail full of great looking wave principle.

Conclusion

So this idea of breaking down a string of joints goes way beyond the scope of just wagging tails (although its illustration is particularly clear here). A character walking will exhibit this wave principle in their arms (shoulder, elbow, wrist, and even fingers for lanky characters), their backs, and especially in things like floppy hats or even ears. Being able to create effective wave principle by creating poses and then offsetting the keys in the Dope Sheet allows for a beautiful fluid animation in a short time.

Tutorial 9.3: A Walk Cycle

Yes, it’s a big jump to go from a wagging tail to a walk cycle. Walks are among the most complex animations around — a symphony of rotations, twists, and weight; and often students attempt it way too early. Walk cycles are often best done by animators who have set a whole lot of keyframes in their career.

So, with that understanding, we’re going to tear into it here. The goal, of course, is not to have a perfect walk cycle at the end, but to have a decent cycle that helps explain one approach to character animation.

Game Character vs High-Rez Character

Carl—the alien—is a low-poly character. He’s been modeled, textured, and rigged as a game character. We are going to continue this trend with this walk cycle.

This means that we are going to make a true cycle. High-rez characters — for things such as movies and TV — should hardly ever have a true cycle. When we walk down the street, each step is just a little different from the one before. We are constantly adjusting for changes in the surfaces we are walking across, we’re looking around, walking different if it’s a man approaching us than if it’s a woman. And still different depending on how attractive the person is who’s approaching us.

But in games, we are looking for a narrower, sleeker collection of data. While a character for a movie might have a walking animation that is 1200 frames long, for a game we’ll want to keep this much shorter; in this case, 24 frames.

Further, for TV/film, it will be important that when the foot lands on the ground, or a step, or a rock, that it stays there until it’s time for it to lift again for the next step. We don’t want any slippery feet. But for a game, the actual translation of a character is usually driven by script and user input. What happens is the game engine tells the character, “Move forward, and while you’re doing it, go ahead and play the walk cycle animation.” The rough visual effect is the character walking along the surface; but a really close look will often yield a bit of sliding of those feet across the surface.

This means that we’ll be animating this character as though he were walking on a treadmill; the imaginary floor will be sliding beneath him while he stands in place. This is actually a really nice way to start learning to animate a walk cycle as the character stays in the middle of the screen.

Layered Animation

There are lots of different ways of approaching a walk cycle. There is so much happening there, that sometimes the biggest challenge is just keeping track of what is happening when. Some animators like to go from completed pose to completed pose — they pose every joint on the character (setting keys for each joint as they go) — and then move to the next keyframe and completely pose every joint for this new time. This can work, but can get pretty tricky to keep everything straight.

I prefer to work with a much more layered approach. I tend to animate just the legs first and get the cycle complete with just the legs animating. Then, animate the feet within that movement, then the back, and then the arms. This happens in multiple passes with all the keys for all the frames being set for the particular region being animated. It means the animation looks goofy at first, but helps me keep in mind when everything should be doing what.

Step 1: Set the project and make a new file.

Step 2: Select File > Create Reference. Navigate to the rigged version of your alien and click the Reference button.

Why?

Referencing a file links to that file — but doesn’t import it directly. This is a great way to work in animation situations. What it means is that if you have 40 scenes that all use the same referenced character, and you make changes to the original character, every scene that the character is referenced in will be automatically updated. This is of great help when animating and discovering skin weights issues, as you can adjust skin weights in the original and not have to reimport or reanimate all the situations where the character is placed.

Animating a referenced character is the same as though you were actually animating the original. The restrictions are that you can’t delete any parts of a referenced file. And, if you need to adjust the skin weights, you have to open the original and change things there, then re-open the Maya scene where the file is referenced. Still the benefits wildly outweigh the drawbacks.

Step 3: Save the scene as Alien_Walk.mb.

Anatomy of a Walk

There are several ways to attack a walk. For us, here we will be splitting the walk into five main poses: left footfall, low, passing, high, and right footfall (Fig. 9.26).

image

FIG 9.26 Five main poses of the walk.

There are other things that happen between these poses — particularly in the feet; but these five are the key poses.

Standard march time is a walk cycle in one second. This means for us our left footfalls will be on frames 1 and 24 (one cycle). The right footfall will be in the middle (frame 12). Passing poses will be halfway between each (at frames 6 and 18). The low and high poses happen between the footfalls and passing poses. For simplicity’s sake, we’ll have low poses for one side at frame 4 with its high at frame 9 and for the other side low will be at frame 15 and high at 21.

Knowing these numbers will give us a good groundwork upon which to start to set keyframes for the hips and feet.

Step 4: Position the alien. Select the big C (or whatever your letter is) and move the alien so that his root is about at Z = 0 (Fig. 9.27).

Why?

In my case, the alien was modeled not sitting with his center of weight in the Z axis. Although this isn’t critical, it makes seeing where the weight of the character is and how far forward each of the feet is much easier.

This is really the beauty of the master curve—the big C. We can move everything at once to wherever the animation is to begin.

Step 5: Animate hip Y rotation for left footfall pose. When the left foot is forward, the left hip will be forward and vice versa for the right foot. Select the Root joint (which controls the hips). Make sure the Current Time

image

FIG 9.27 Moving the alien into place by using the big C.

Marker is at frame 1 and rotate the hips around — 10 degrees in Y. You can do this either with the Rotate Tool, or by manually entering — 10 in the Channel Box (Fig. 9.28). Hit s to set the keyframe.

Step 6: Set an identical key at frame 24. Still with the Root selected, move the Current Time Marker to frame 24 and hit s again.

Why?

We’re animating a cycle here, so the first frame and the last frame should be the same. By setting the key twice while the object is selected, we keep things clean and avoid having to do a lot of copy/pasting of keys later.

 

image

FIG 9.28 Setting the first hip rotation pose by setting a keyframe for the Root joint.

Step 7: Set hip Y rotation for right footfall pose. Move the Current Time Marker to frame 12 and rotate the hips to Y = 10. Hit s to set the key.

Tips and Tricks

When changing values in the Channel Box, hitting s won’t set the key. Be sure to move the mouse over to the View Panel before hitting s.

 

Why?

Frame 12 is the frame where the right footfall pose will be; thus, here’s where the hips will be rotated opposite of the left footfall pose.

Step 8: Set keys to show weight on passing poses. When the weight is all on one foot (as it is in the passing poses), the hips will rotate to show this. Additionally, the hips will slide over the top of the leg that is bearing the weight. Move the Current Time Marker to frame 6 (when the left foot is on the ground and the right foot is passing). Select the Root and rotate it around its Z by 5 degrees (this can be done visually or in the Channel Box) and move the joint over in X so that it is more over the left foot (for my scale this was 1.5 units [Fig. 9.29]).

image

FIG 9.29 Setting keys to show weight in hips.

Step 9: Repeat for the other passing pose at frame 18. Of course, here the hips will be shifted over the right foot (−1.5 units in X) and rotated opposite (Rotate Z = −5).

Tips and Tricks

For fun, play the animation now. Groovy little dance he’s doing.

 

Why?

There are other hip animations that need to take place — particularly its animation in Y for the high and low poses. However, we’re going to hold off on this for the moment as it will be easier to see how high or low it should be once we get the feet in place.

Step 10: Position the feet (L_Foot_Cntrll and R_Foot_Cntrll) for a left footfall. Notice that this does not include the foot roll at all, it’s just the placement of the feet. Don’t take very big steps, but get the left foot in front and the right foot behind. Place them so the character looks balanced between the two (Fig. 9.30). Be sure that after posing L_Foot_Cntrll, you hit s and then pose R_Foot_Cntrll and hit s again.

image

FIG 9.30 Placing the feet for a left footfall.

Why?

I know, he looks broken right now. Part of this is because we are asking the leg to stretch farther than it is able. Not to worry though, once we get those feet rolling, this will clean up.

Step 11: Set keys for both at frame 24. Do this by moving the Current Time Marker to frame 24 and then select each of the controls and hit s for each.

Why?

Still animating the loop. Frames 1 and 24 should be the same.

Step 12: Position the feet for right footfall (just mirrored of left footfall) at frame 12. Be sure and set a key for each.

Step 13: Set keys for passing poses. Do this at frame 6 by lifting the R_Foot_Cntrll just a little off the ground and setting a key (Fig. 9.31). Then again at frame 18 lift the L_Foot_Cntrll just a bit and set another key.

image

FIG 9.31 Lifting the feet for passing pose.

Foot Rolls

Now that we have basic placement, we need to start to get the foot roll working for us. This will help solve some of the hyperextending knee problems that we have and put us in position to better place the root.

A few notes about the foot roll rig. Each of our foot roll handles is built to give the foot a new axis along which to rotate. This means that the best solution will be to generally have only one of them activated at a time. If the heel handle is activated at the same time as the toe, it will lift the foot in strange ways.

To help keep this from happening, I like setting keyframes for all three handles on each foot, at every place there is a foot roll key. So if the character is posed with its heel touching the ground (like he will on left footfall), I set a key not only for the L_Heel_Cntrl, but also for L_Ball_Cntrl and L_Toe_Cntrl.

Step 14: Pose the left foot roll for left footfall. This is done at frame 1. Rotate the L_Heel_Cntrl up (Rotate X = −30) to make it so that the heel is hitting the ground (Fig. 9.32). Hit s to set the key. Also be sure to select L_Ball_Cntrl (hit s) and then select L_Toe_Cntrl (hit s).

image

FIG 9.32 Using the left foot roll rig to pose the left foot at the left footfall pose.

Step 15: Jump to frame 24 and set a key for each of the three foot roll handles again.

Step 16: Set the left foot to be flat on the down pose. Do this by moving the Current Time Marker to frame 4 and rotating the L_Heel_Cntrl back to 0. Hit s to set the key and do the same for L_Ball_Cntrl and L_Toe_Cntrl.

Step 17: Keep it flat to the passing pose at frame 6. Move the Current Time Marker to frame 6 and make sure that L_Heel_Cntrl, L_Ball_Cntrl, and L_Toe_Cntrl are all set to Rotate X, Y, Z = 0 (the foot flat). Set a key for each.

Why?

When that foot is the only thing holding the character up, the foot will be flat as long as possible. Keeping it flat between the down pose and passing pose will help ground the character.

Step 18: Rotate the foot up on the ball at the up pose. Do this by moving to frame 9 (up pose). Make sure the L_Toe_Cntrl and L_Heel_Cntrl are both rotated to 0. But, make sure that L_Ball_Cntrl is activated and rotated up (I used Rotate X = 20). Set a key for all three handles as you check or alter each (Fig. 9.33).

image

FIG 9.33 Rotating the foot up to the ball on the up pose.

Step 19: Rotate the foot up onto the toe at the right footfall pose. Move the Current Time Marker to frame 12 (right footfall pose) and rotate the L_Toe_Cntrl to rotate the foot up (I used Rotate X = 40). Hit s. Set both L_Heel_Cntrl and L_Ball_Cntrl to be rotated to 0. Be sure to hit s to set a key for each of those (Fig. 9.34).

image

FIG 9.34 Rotating up to the toe on right footfall.

Step 20: Finish the left foot by refining the passing pose. Move the Current Time Marker to frame 18 and make sure that the L_Toe_Cntrl is set to Rotate X = 40 (hit s), but that L_Ball_Cntrl and L_Heel_Cntrl are set to Rotate X = 0 (hit s for both).

Why?

I know this is going to look all sorts of broken right now. Hang with me. We’ll get much of this fixed as we work through the position of the Root joint in a bit.

Step 21: Repeat this foot roll process for the right foot as well.

Step 22: Update the Root joint’s positioning for the left footfall, right footfall, and both passing positions. Be sure that with each pose adjustment at each frame that you hit s. This will likely entail moving the Root forward a little bit at each of those poses, and perhaps dropping it a bit to avoid hyperextension (Fig. 9.35).

image

FIG 9.35 Adjusting Root control to fix any knee hyperextension.

Why?

Now that the foot roll is rotating like it should, there can be havoc to clean up with the knees. Ironically, the way to correct problems with the knees is to change where the Root joint is. By tweaking the Root joint to be appropriate to the footwork, things will smooth out.

Upper Body

Now that the lower body is animated, animating the upper body is largely about counteracting what’s happening in the hips. When the left hip is forward, the right shoulder is forward. We can make this happen by rotating the joints that define our back.

After the back is defined, we can go back and add the rotation of the arms as appropriate.

Step 23: Balance the body through a torsion twist of the back. We’ll do this at frames 1, 12, and 24 (the footfall poses). Select the joints that are the back (Back_Base, Back, Clav_Base) and then starting at frame 1, rotate them so that the shoulders are opposite to the hips (so, for instance, at frame 1, the right shoulder is rotated forward by rotating all the three joints 12 degrees [Fig. 9.36]). Take note of what the rotate values are here as they will be just opposite at frame 12. Values at frame 24 will match those at frame 1.

image

FIG 9.36 Rotating the back and shoulders to counteract the rotation of the hips.

Step 24: Balance the back at passing poses. This one is a little trickier; but the concept is the same. Take a look in the front view and look at frames 6 and 18. Because the hips are rotated to show the weight on one leg, the whole body will be crooked. Select each of the back joints one at a time, and rotate (only along Y) to counteract and balance the form (Fig. 9.37). You’ll need to do it one at a time because positive Y for one joint may rotate the back in the opposite direction as the joint above it (some will need to rotate positive and some negative). The results should be a more balanced alien like Fig. 9.37.

Step 25: Balance the head. At the same frames 1, 12, and 24 (footfall poses) and again at passing poses (frames 6 and 18), rotate the head so that it is level.

Why?

So the idea here is to animate the hips and then, working up the body, balance each part of the body to counteract the rotation that is happening beneath it. It’s what your body does when it walks as well.

 

image

FIG 9.37 Balancing on passing poses.

Step 26: Pose the arms. At frame 1, rotate the shoulders, elbows, and wrists to match Fig. 9.38. Notice that the arms are opposite to the legs — so if left foot is forward, then right arm is forward. Remember that each time you move a joint, be sure to hit s to record the key. Also be sure to set a keyframe at frame 24 to match frame 1 for each joint. Move to frame 12 and rotate the arms opposite.

image

FIG 9.38 Animating the arms.

Step 27: Tweak, tweak, and tweak. Basically, the mechanics of the walk are done. But there are loads and loads of changes that can and still should be made. What can you do to add good wave principle to the arms? How should the hands be posed? Can you add more weight to the head? Tweaking is the real fun of animating; so be sure to have fun doing it.

Rendering Animations

Once you are sure you’ve got a good animation, it can be fun to render the animation out. Yes, I know, this is a game character and would be rendered in real-time in game. But, let us pretend this is part of a TV or film project.

Maya works best when you render animation as a series of sequential stills. Recent versions of Maya allow you to render directly to .avi or .mov, but I still recommend rendering to sequential stills. With sequential stills as the core output, changes can be easily made to just a few frames, and then you only have to re-render those few frames and not have to worry about finding where they go in the sequence.

Of course the drawback to this sequential still approach is you need to have some software that will allow you to assemble the stills. But there are lots that will do this, Adobe Premiere, AfterEffects, or the $29.95 version of Quicktime Pro. Maya even includes a sequential still viewer — Fcheck — that we’ll look briefly at.

To render an animation, have your scene set up with the lighting scheme you have planned and the camera positioned as you want. Then choose Window > Render Editors > Render Settings.

Here you can choose things we’ve already talked about (rendering engine, resolution, etc.). Of particular importance are the highlighted areas of Fig. 9.39.

Frame/Animation ext: allows you to define how the images are going to be named. This becomes very important when dealing with hundreds of output frames. My favorite for animation is “name_#.ext” For this project, this would output files named “Alien_Walk_001.iff, Alien_Walk_002.iff, etc.” The Frame Padding setting tells Maya how many 0’s to put in front of the frame number so that the stills are really seen as sequential in various editing packages.

The Frame Range area allows you to define what frames are to be rendered. The default is between frames 1 and 10; but in this case, we would want frames 1–24. Or to be even more sophisticated, since frames 1 and 24 are the same — and we wouldn’t want that frame played twice if the animation is looped, we could render from frames 1 to 23 so a looped animation would be smooth.

image

FIG 9.39 Render Settings for animation.

Click Close when the settings are finished.

To actually render the frames using these settings choose Rendering | Render > Batch Render. This is a pretty anticlimactic step as all you’ll see is on the bottom of the interface a single line that tells you the progress of the render (Fig. 9.40).

image

FIG 9.40 Rendering progress line letting you know that Maya is working away on the render.

These stills will be rendered to the images folder of your project.

To view them quickly, open FCheck (on a PC it can usually be found under the Start Menu > All Programs > AutoDesk > Autodesk Maya 2012 > FCheck. On a Mac go to the Applications folder > Autodesk > maya2012 > FCheck.

Once in FCheck choose File > Open Animation. Then navigate to the first frame of the sequence, hit Open and FCheck will load the frames into memory where you can view the animation playing in real-time and even scrub through it by dragging across the image.

Conclusion

Don’t sweat it if the walk doesn’t come right away. Truth be told, short characters with big feet can be particularly tricky to animate. If you’re really struggling with this, you may try using a more traditionally proportioned character — like the one built for my other Focal Publishing book Creating 3D Games with Unity and Maya. The rig we build in that book is available online at http://creating3dgames.com.

My final animation for this little character is on the supporting website for this book at http://gettingstartedin3D.com.

And with that we’re done. We’ve come a long way in this volume and covered a huge number of new concepts. Hopefully, the tutorials have provided a good groundwork upon which you can increase your skills and talents. The key will be moving beyond the tutorials — doing projects that aren’t laid out in tutorials.

The next step will be to take all the new ideas and design and create your own room, level, furniture, textures, character, rig, and animation. It’s where you’ll get to test how well you really understand the ideas we’ve talked about. It’ll be a sort of self-assessment. Come back and brush up if there’s an area you’re shaky on — but keep building your own vision.

Good luck!

Homework

1. Revisit the bouncing ball. Have it hop forward four or five times. How would the animation change? How would his poses help broadcast his intent to jump forward or to land?

2. Make that alien run in a run cycle.

3. How would the alien move differently if he had a heavy gun in his hand. Try the walk and run with a heavy item in one of his hands.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset