The Cow Tutorial
Introduction to computer animation using Maya


Click here for Preview PlayBlast of final animation


Part 3. Animation

Preparing the model for Animation

We need to set up the cow model to be animated by creating groups. The top of the grouping hierarchy is a single node which is the entire model. The parts which are animated as a unit (such as all of the parts which make up a single leg) must be collected into a single node as well. If you model is not grouped at all yet, it is a good idea to start with the smallest parts first. For instance select all of the parts which make up the wind-up key and click >Edit>Group (cntrl g). Name the new node "Key". Next select the two arms, and group them in a node named "Arms". Now select the base of the body, and the leg slot parts and group them into a node called "Bottom". Since the neck moves as a fixed part of the body group the neck parts now too. The tail parts should be grouped as well. Since the upper body is a single piece. Now select the "Neck", "Arms" ,"Bottom", "UpperBody" ,"Tail" and "key" and group them. You now have a single node which you can name "Body".

In the Hypergraph (>Window>Hypergraph) you grouping should look like this:

Create a similar group for the Head (include the geometry of the eyes) and the Legs. The eye control is a separate group. Now select "Head", "Body" ,"Legs" and "Eye Control" and group them into a single node called "COW". As your cow walks we will animate the forward motion of the whole character using this "Cow" node. In order to move the walking cow to wherever you might need her in the scene you will need an additional node above "Cow". Select "Cow" and group it to itself (>Edit>Group). This creates another node for the same objects which can be animated or manipulated separately. I called this top node "Wind-up Cow".

Moving Pivot Points

The cow's legs move by rotating from the top of the hip. Right now, if you select the Left leg and rotate it - the rotation center will be the center of the grid. Whenever you create a new group, by default, the center - or pivot point - of the new group is the center of the grid (i.e. coordinates 0,0,0). In order to rotate the leg properly we need to move the pivot point to the top of the leg geometry. slect the "Move" tool (hot key w), you will see the Move manipulator arrows at the center of the grid. Now click "insert" on your keyboard. The move manipulator changes to a small round, yellow icon. Moving this icon changes the pivot point. In the side view your leg models should be centered along the Y axis. You can Snap the pivot to the Y axis, by holding down the "x" key while moving the pivot. In the front view center the pivot point each leg.

When the pivots points are in the correct locations simply click "insert" again to return to normal mode.

Preparing to Animate

Before we begin to animate the cow, we want to make sure all of the tools and menus we will need to use are visible.  Switch to the Animation menu.   Make sure the Range slider, and the Time Slider and Channel Box are checked under Options.  Your window should look like this one.

 

The range slider shows to whole range of your animation, you can type in 1 and 300 in the boxes to the outside. The boxes to the inside indicate what range is viewable the timeline. and this can be adjusted using the gray slider bar in the center.  Since our animation is so short (300 frames at 30 fps = 10 seconds) we can leave the whole range viewable on the timeline

 

The Walk Cycle:

The cow will be walking, his legs, body and head movement are continuous and there fore can be cycled.    Since this sample project is a total of 300 frames long, we want the range slider to read from 1-300. First we will make the legs walk in place. We need only set 5 keyframes for each leg in order to complete a single step. This step when cycled (repeated continuously) will be a walk.

The 5 poses will look like this:

Go to frame 1 on the time slider.  You can do this by typing in the number "1" in the area labeled "current keyframe" on the diagram above, or by clicking the arrow labeled "go to first frame" in the diagram, or,  by simply clicking at the 1 on the time slider itself.  (The Left leg is highlighted in the above illustrations.) Leave The Right leg where it is, and click >Animate>Set Key. Now at frame one of your animation you have set the position of the right leg. The Left leg should be moved forward along the Z axis until it is just infront of the left leg. (if your model is scaled like mine use a value of .15 in the Translate Z attribute). Now set a keyframe for the left leg. (This actually sets a key frame for all the attributes of the leg, and if you notice all of the value boxes in the Channel box turn color.  That is OK - we will get rid of the non-esssential keyframes later.) Now move to frame 8 on your timeline. Move the left leg back to Z=0. Rotate the right leg (Rotate X value -10) and raise it along the Y axis (Tranlsate Y .161). This lifts one leg over olatform protrusions of the other leg. Set keyframes on BOTH the left and right legs. Use the following as a guide to set the 5 keyframes for each leg: (TY=translate Y, RX =rotate X etc.)

Keyframe 1

Left Leg: TY=0 | TZ= -0.15 | RX=0

Right Leg: TY=0 | TZ=.15 | RX=0

Keyframe 8

Left Leg: TY=.161 | TZ=0 | RX= -10

Right Leg: TY=0 | TZ=0 | RX=0

Keyframe 15

Left Leg: TY=0 | TZ= .15 | RX=0

Right Leg: TY=0 | TZ= -.15 | RX=0

Keyframe 22

Left Leg: TY=0 | TZ=0| RX=0

Right Leg: TY=.161 | TZ=0 | RX=-10

Keyframe 29

Left Leg: TY=0 | TZ= -0.15 | RX=0

Right Leg: TY=0 | TZ=.15 | RX=0

Notice that Keyframes 1 and 29 are identical. In order for the cycle to work properly the first and last keyframes must match.

 With your left mouse drag back and forth over the area of the Time slider which has these keyframes.  You should see the legs moving.   This is called "scrubbing" though the animation.


Now we have one complete step. We will use the Graph Editor to make the legs cycle continuously throughout the animation, thus walking in place.

 With the left leg selected, open (window> animation editor> graph editor). (*Note the track and dolly view manipulators you use to move around in the view panels also work in the graph editor. (You can frame a curve or key frame with hotkey "f").

The attributes are listed by name on the left, and are represented by a curve in the right.  If you recall, when we set the keyframes we set them on all the attributes (animated attributes are known as channels).  We are only interested in the TY, TZ and RX so let's get rid of the other curves.  On the main menu (not the graph editor menu), with the left leg still selected press (edit> delete by type> static channels). Now in the graph editor all of the channels, except the those with keyframes should go away.  To frame these curves in the graph editor, hold RM over the right side of the graph editor (where the curves are), and click view> frame selected. Your graph should look something like this:


Graph Editor

The Keyframes are represented by black dots, the numbers across the bottom show the time, and the numbers on the left are the numerical value of the channel.  The curves show the transistion of the attribute value from one keyframe to the next.  To make the leg action continue throughout the animation, select the curve and press (curves> post infinity> cycle). In order to see the results of this action press (view> show results) this may take a few seconds but you should see the curve repeat itself in a sine wave sort of pattern.

We want to change one more thing about this curves before we go on.Examine the shape of the curves As the curve passes through a keyframe it can behave in several ways depending upon the type of "Tangent" of the curve.  WE will discuss tangency more thouroughly in class but for this animation, since we are dealing with a mechanical toy, we will use Linear tangencies. Select all of the curves (box select over the curve avoiding keyframes to select curves). Then in the Graph Editor menu, click >Tangents>Linear.  Now the curves should look more like a zig-zag lines.  Since the motion now doesn't flow through the keyframe, instead, it changes abruptly at the keyframes, it will give the legs a snappier motion, more robotiv motion.  Repeat the process forthe right leg. Close the graph editor, and press the play arrow to see your cow legs in action.

PLAYBLAST

As you are animating your cowyou will want to preview exactly how the motion will look when you render it out.   Simply hitting "play" and watching you animation in the view window, is not a very good indicator of how your piece will play.  The more complex your view - the slower the playback.  You can simplify your view to help playback more quickly, by always keeping to wire frame mode (4), rough display (1).   However you will also want a more accurate preview of you animation with surfaces and textures.  You can easily do this using Playblast.  Enlarge your persp1 window to full size (space-bar) and press (Window> Playblast - option box).  To begin with, for early tests, we will not be saving these playblasts.  Later, when you have a version you are happy with you can save the playblast as an .mov file.  For right now set up you options as follows:

Time Range: Time Slider (for the whole animation)  or, if you want to review just a portion of you piece, choose Start/End and type in the frame numbers
View: Check this to allow you to watch frame by frame as the playblast renders

Show Ornaments: leave this OFF, unless you want to render things like IK handles and joints

Viewer: select MoviePlayer

Compression: since we are not saving - leave this for now

Display Size: Choose "from Window"  which will create the playblast based on the size of you view display rather than from the Render Globals

Scale:  a half-size playblast will be good enough and will be much quicker so use .5 here.

Remove Temporary Files: check this so that you are not storing multiple playblasts in RAM

Save to File: Do not check this - right now we are just testing the motion.

Now press (Playblast). Your animation should play very slowly, at half size in the lower left corner of your window.  When it has played through once, a new window will appear,  click in this window to activate the movie player and study the motion of your animation.  It is a good idea to do fairly frequent playblasts  while tweaking the animation.

Body & Head Motion:

Reminder: (To set a key frame, you may use hotkey "s", or, in the channel box- LM "Channel> keyframe all' (or if you have attributes highlighted you may choose "key selected" ) or  from the main menu press (Animate> Set Key).

The body of the cow rocks as she walks - it moves both side to side (Rotate Z) and front to back (Rotate X). Remember when you made the grouped the body parts the pivot point of the new group was the center of the origin. Select the node called "Body" (this includes the neck and arms) and center the pivot (>Modify>Center Pivot). The body tilts in relation to the legs so we will set the keyframes at the same points as the legs. (1,8,22,29). At frame 1 the feet are both flat on the floor so the body is not tipped. Therefore set the RZ and RX values to 0 and set a keyframe. At frame 8 the left leg is raised and moved forward - the body should tilt back and toward the right leg. I used a Rotate X value of -3 and a Rotate Y value of 3:

At frames 15 and 29 the feet are flat on the floor so the body has no rotation. At frame 22 the right leg is raised so I used RZ of -3 (the opposite of frame 1) and an RX of -3 (same as frame 1). In the graph editor cycle these motions the same way we did the legs. The cow should now be walking in place.

The head tilts back and forth in relation to the legs as well. When the right leg is lifted - the head tilts left and vice versa. Since in our 5 keyframe cycle we have one frame where the left leg is raised (frame 8) and one frame where the right leg is raised (frame 22) Set the head tilts at those two frames.

If you recall for a cycle you need the first and last keyframes to be the same. Since we only have two keys set on the head we want it to oscillate (back & forth) rather than cycle. In the Graph Editor select the curve and click >Curves>Post Infinity>Oscillate.

You can animate the key turning by setting a key at RX=0 at frame one and RX=-360 at frame 30 (one full rotation in 30 frames or one second) and cycling it. (In this case a regular cycle is OK with 2 keyframes since we want it to go back to 0 after -360)

Now all that is left to get her walking is the forward motion. In order to make the cow walk forward we need to determine how far she moves forward with each step. As she lifts one leg the other should remain planted. Right now if you examine the "staionary" foot you notice that it slides back as the other foot goes forward. We need to make the position of this foot remain constant until it is raised in turn. To do this you can create a dummy object which is not animated to determine the foot placement. Create a Cube and translate & scale it to be directly below and the same length as the right foot(the forward foot) in frame 1:

select the "Cow" node (this includes all cow parts including the legs) and set a key frame at Frame 1 for Translate Z=0. In frame 8 the left leg is raised, and in frame 15 it touches down. We want the right leg to remain exactly where it is during these frames. Go to Frame 15, you will see that the right foot is now behind the dummy cube. Select the "Cow" node and move the cow forward until the right foot is again directly over the cube, which has not moved.

Set a key frame on the Translate Z of the body. This establishes the distance of a single step. In the Graph Editor select the curve for TZ of "Cow" and click >Curves>Post Infinity>Cycle with offset. The offset will add the value of a single step distance as it cycles the forward motion. Thus if the TZ value at frame 15 is .3 then at frame 30 it will be .6. Repeat this process for the left foot. Move the cube under the left foot at frame 15 and adjust the "Cow" TZ if necessary at frame 29 and set this keyframe. The cow feet now stay planted step to step.

 

Secondary Motion:

  You can also make her look around by setting key frames on his Eye_Control.  There should always be a blink or two in an animation, most of us don't go too long without blinking.  Select the eyelid spheres and animate RX to make your cow blink. A blink consists of four keyframes.   I used 3 frames to close - three frames closed - 3 frames to open for the timing in this animation. First keyframe an open position, 3 frames later, key a closed position, 3 frames later another closed position keyframe.  This keeps the eye closed for 3 frames, then key another open position 3 frames later to open the eyes again. 

 

Animate some eye motion to make your cow look around by keying translation of the eye control node.

Keyframes can be deleted by holding the right mouse over the red keyframe line in the Time Slider and choosing delete from the menu.  You can also delete keyframes from within the Graph Editor, by selecting the keyframe and from the Graph Editor's own menu pressing Edit>delete.

Run some more Playblasts and continue to tweak the motion.  When you are happy with the entire sequence we will go on to render it.

 

 

Go to Part 5. Rendering