The Character Tutorial
Introduction to computer animation using Maya
Center for Advanced Digital Applications


Part 4. Animation

(Please check in your hypergraph view now to be certain that your character is set up properly (see Part 3. Rigging)  You must have your skeletal system and your surface geometry in separate hierarchies.)

Before we begin to animate the bee, 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 Wing Cycle:

The bee will be flying on a motion path, his arm, leg, head and antennae movement will be added after that.  Before we do that however we can animate the flapping of his wings.  We wil animate one flap and then cycle the animation to continue so that he will continue to flap his wings throughout the piece.    Since this sample project is a total of 300 frames long ,  we want the range slider to read from 1-300.

(NOTE: *If the pivot points of your wings are NOT at the tip where the wing joins the body surface you need to move them now.  You can move a pivot  point by using the move tool and pressing "insert", moving the pivot to its new location and pressing "insert" again to return to object mode.)

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.  For this tutorial I made the individual wings L_wing1, and L_wing2 rotate up and down (ie a Z-rotation) in s scissors type motion, and the pair of wings L_wing rotate back and forth (ie a Y rotation) in a flapping motion.   so first pick L_wing1, and rotate it,  and L_wing2, and rotate it, until they are essentially on top of one another, like a closed scissors.  Press (Animate> set key) for each wing.This actually sets a key frame for all the attributes of the wing shapes, 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 a few frames ahead, probably about to frame 4 and rotate Lwing 1 and L_wing2 into an open scissor position and press (Animate> set key) for each wing With L_wing selected, return to frame one, and hold the right mouse (RM) over the 1 on the time slider and click "copy".  This copies the attribute information from that keyframe.  Move to frame 8 in the time slider, hold the right mouse over it and click paste.  Do the same for L_wing2.  With your left mouse drag back and forth over the area of the Time slider which has these keyframes.  You should see the wings going up and down.  This is called "scrubbing" though the animation.


Closed scissor                               open scissor

Now lets do the flap motion.  Select L_wings (the pair) and set a key frame at frame 1 for one extreme of the flap - perpendicluar to the bee's back.  Then set a key frame for the other extreme, nearly flat against his back at frame 6 (he will flap slightly slower than than he does the scissor motion).   Copy the first keyframe (the perpendicular pose) onto frame 12.

The flap positions

Now we have one complete wing cycle.  We will use the Graph Editor to make the wings cycle continuous throughout the animation.

 (*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").

With L_wing1 selected, open (window> animation editor> graph editor). The L_wing1 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 rotations for the wings so let's get rid of the other curves.  On the main menu (not the graph editor menu), with L_wing1 still selected press (edit> delete by type> static channels). Now in the graph editor all of the channels, except the rotations 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 this 8 frame action continue throughout the animation, select all of 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 curve before we go on to the rest of the wing surfaces.  You will notice that the curve above flows smoothly through the key frames.  that is because the "Tangent" of the curve is flat.  Select all of the keyframes of your initial curve, and press (Tangents> Linear).  Now the curve should look more like a zig-zag line.  Since the motion now doesn't flow through the keyframe, instead, it changes abruptly at the keyframes, it will give our wings a snappier motion.  I used Linear Tangents for the scissor motion, and Flat Tangents for the flap which I thought should flow a bit more smoothly.  Repeat the process for L_wing2 and for L_wings.  Repeat the process for the right wing group.

 

The wing animation curves before and after cycling

Close the graph editor, and press the play arrow to see your bee wings in action.

The Motion Path:

Before attaching the bee to the path - let's make sure he is set up properly from the last lesson.  It is very important.  You should have all of geometry of the bee grouped and named Bee_Geometry, except for those items, such as the eyes, and wings which were parented to a joint.  This group should stand alone. 

You should have another group, called Bee_Master, which includes the skeletal hierarchy (ie Bee_Root) and the Bee_IKs as siblings.  You should have an two additional nodes which is also made up of the Bee_Root and the Bee_IKs, (but which are children of Bee_Master) these node are called Bee_Transform, and Bee_Path.

We are going to use the Bee_Path node to attach the bee to a motion path.  That way the whole setup moves along the path including the IK handles.

Now lets draw the path.  The Path is simply a NURBS curve.  (The path itself will not be visible when you render the animation)  To draw the curve, (select> CV curve tool) and place the CVs.  It is a good idea to draw it first in the top view, then give it some variation by moving the CV's in the other views.  Try to keep it simple, remember it can always be modified later by moving CVs.  Here is the curve used for the bee I did for this project.   You don't have to place the bee at the beginning of the curve.  Just leave the bee model where it is (at the origin in neutral pose) and when we attach it to the path it will move into position at the beginning of the curve.


motion path curve

To attach the bee, select the Bee_Path node and shift_select the path curve, press (animate> path> attach to path - option box).  The options should be set up as follows:

Time Range: time slider (this means the character will be on the path for the entire duration of the animation shown on the time slider)  If you want your character to only be on the motion path for a portion of the animation, use Start/End and enter the keyframe numbers.
Follow: checked (your character's front axis will be oriented along the path)
Front Axis: Z  (this is the direction your character is facing)
Up Axis: Y (the vertical axis of the character)
Up Direction: world up
Bank: Check this if you want your bee to tilt as he makes turns.  You can leave the Bank scale at 1 but you should probably turn down the Bank Limit to about 25 or 30.  You don't want him tilting 90 degrees even around that hairpin curve!

Now click "Attach".  It may take a second or two but your character should pop into place at the beginning of the motion path curve.   Press the play arrow or scrub through the animation with your LM over the time slider to see the animation so far.  The bee should move along the motion path.

A New Camera:

Now is a good time to set up a new camera or view.  You need to decide upon the angle at which you want to see you animation in the final render.  In the perspective window, press (panel> perspective> new).  Your perspective window now changes to persp1 view.  Go to the last frame of you animation,and tumble, track or zoom until you have a good view of the front of the bee.  This is where you want him to be at the end of the animation.  Play the animation and, viewing it in this window, adjust the tracking and zooming, and the CVs of the path until you are satified with the view throughout the animation.  Still in persp1 view click on view> safe action.  A frame appears in the view panel - the area within this frame will appear in your final render.   Now as we continue, check this view to see how your final animation will look, but DO NOT use this view to work on the animation.  Click on panel> perspective> persp to get back to the perspective window to work on the animation.  You may want to replace one of the orthographic views, (the side or front probably) with the camera1 view so you can refer to it.

PLAYBLAST

As you are animating your character you 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).  You can even preview a character's motion by just watching the skeleton (unclick show surfaces).  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.

Additional Motion:

So now we have our bee, wings flapping, floating along the motion path and tilting at the corners.  You now will want to modify his poses and set key frames as he travels along the path.  Use your persp1 window to check his poses at various points along the curve.  At frame one let's set up his initial pose.  Using the Bee_Transform node rotate the whole bee character so that he is not perpendicular to the path and seems to be in a flying position.  Set a keyframe on that node.

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).

Remember, the Bee_Path is the node on the motion path and it is the parent of Bee_transform, so if you key Bee_Transform you are NOT keying the position along the path (ie how far along the path he has travelled) but only his pose at that keyframe.  Also set some keys for the positions of the arms using the shoulder, elbow and wrist joints, and the legs using the IK handles etc. until he is in a satifactory pose for frame one.   Be sure to set key frames for each of the joints or IKs which you modify.  For a motion to be animated it must have a start pose keyframed before the next pose is keyframed.  Don't forget to position the head (do you want him to look at the camera or in the direction he is flying?).  Now scrub forward in the animation about 10 or 15 frames and modify his pose.  Remember to set keyframes on all modifications AND on any joints or IKs which will be modified in the frames to come.  (If you want him to wave at frame 125 and you have key frames for the arms only at frame 1  so far - his arms will slowly begin the upward motion of the wave at frame 2!  You must remember to set a key frame at the start of any new action).  Continue to set new key poses along the path and run frequent  Playblasts.  Use the graph editor to adjust the tangents of the curves to help tweak the motion.

Secondary Motion:

After you are fairly happy with his general motion along the path you will want to add some secondary motion such as making his antennae swing in response to the motion of this head.  You can also make him 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.  In order to make him blink You need to shift_select both of his eyelid surfaces, and in the channel box, under makeNurbsSphere animate the Start Sweep or End Sweep attributes.  (remember if you highlight an attribute in the Channel Box by clicking on the word not in the box, you can change the value interactively by dragging anywhere in a view window with the Middle Mouse button.)  A blink consists of four keyframes.   First keyframe an open position, 4 frames later, key a closed position, 2 frames later another closed position keyframe.  This keeps the eye closed for 2 frames, then key another open position four frames later to open the eyes again.  ( you can also cycle blinks so that he blinks every 50 or so frames if you like.  Set up just like the wing sequences but add an additional key frame to hold the eye open during the interval between blinks)

 

NOTE: If there is time, in class, we will discuss using "set drivers" to create new attributes on nodes (also to have one attribute "drive" the animation of another).  We could have set up a "blink" attribute on the Eye Control node for instance, which would have appeared in the Channel box along with the standard attributes, allowing you to animate all aspects of the eye from one node.

Keyframes can be deleted by holding the right mouse over the red keyframe line in the Time Slider and choosing deletefrom 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