041212_14-Animation_031

Lesson 14 Animation

Posted on Posted in AutoDesk Maya, Foundation 2008, Tutorials

Reference

Instead of working directly with your previous file, we are going to referencethe penguin. Reference is a read only and loaded into the current scene. It allows you to animate the character leaving the rig file untouched. If you update the rig file, the file referencing it will get updated.

  1. Create a Reference
    • – Select GENERAL || File > New Scene > □;
    • ANIMATION || File > Create Reference > □;
      • Create Reference Options:
      • Name Clash Options: Resolve all nodes with this string: penguin;
      • Note: this will affix the string penguin to all the nodes you are bringing in.
      • – Click on [REFERENCE];
        • – (Browser Dialogue Box): Select the previous file.
        • Note: The file will load into the current one. In the Outliner you’ll see a diamond icon and red names in the Hypergraph. This tells the user these files are loaded from a read only.
  2. Layers
    • – Turn the visibility: ON for the geoLayer and the setupLayer.
    • – Make sure the smooth attribute on the master node is set to 0.
    • Note: you should now see only the low-res model along with its rig.
  3. Change The View Panels
    • STAGE || Panels > Layouts > Two Panes Stacked.
    • – Change the top panel to Side view and the bottom panel to Perspective view.
    • – For the Side View, select STAGE || View > Predefined Bookmarks > Left Side.
    • – In the Side View, turn Off STAGE || Show > Nurbs Surfaces. & STAGE || Show > Polygons.
    • – Final result

 

Animating a Walk Cycle

Begin your animation by creating a single cycle. To create a cycle you will need the start and the end position to be the same.

Animate The Feet Sliding

Key the horizontal positions of the feet to establish their forward movement. This will result in a sliding motion of feet.

  1. Set Your Time Range
    • – Set the Start Time and Playback Time to 0;
    • – Set the End Time and Playback End Time to 20;
    • Note: This gives you a smaller time range to work with as you build the cycle. Full stride 2 steps of 10 frames each.
  2. Active Character
    • – In the Current Character menu next to the Range Slider, select penguin.
    • What this does: Any keys you set will be set on all the attributes of this character node.
  3. Position And Key the Lower Body Start Pose
    • Key the starting position of the character in the position of a full stride.
    • – Go to frame 0;
    • – Select the lHeelControlselection handle and set the following:
      • Translate Z: 16 units;
      • Roll: -3;
    • – Select the rHeelControl selectionhandle and set the following:
      • Translate Z: 0;
      • Roll: 10;
    • NOTE: Make sure the translate tool is set to world coordinates.
    • – Set the pelvis Translate Z: 13;
    • – Move the pelvis down till the knees bend. My pelvis is Translate Y: 12;
    • – Leave the arms for now.. Values may not match but make sure our character looks similar to the following image.
    • – Select penguin:penguin and press “s”;
    • Note: The entire character gets keyframed since penguin character is selected in the Current Character menu at the bottom right interface.
  4. Position and Key the Right Foot
    • – Go to frame 10;
    • – Set the rHeelControl Translate Z: 32 units and roll: -5;
    • This translation value is exactly double the value of the initial left foot key. This is important to ensure that the two feet cycle together.
    • – Set the lHeelControl roll:10;
    • – Set the pelvis translateZ: 16 units;
    • – Select penguin:penguin and press “s”;
  5. Position and Key the Left Foot
    • Move the left foot similar to the starting position.
    • – Move to frame 20;
    • – Set the lHeelControl translateZ: 48 and roll: -3;
    • – Set the rHeelControl roll:10;
    • – Set the pelvis translateZ: 48;
    • – Select penguin:penguin and press “s”;
  6. Save: 041712_14-Animation_01.ma

Edit the Animation Curves

Refine the in-between animation by changing the animation curves, tangent options.

  1. View the Curves in the Graph Editor.
    • Edit the animation curves produced by the keys in the Graph Editor.
    • – Clear your selection.
    • GENERAL || Window > Animation Editors > Graph Editor.
    • Graph Editor: highlight the penguin character
    • – Select STAGE || View > Frame All.
    • – CTRL + SELECT the lHeelControl:TranslateZ  and rHeelControl:TranslateZ in the Outliner section of this window.
    • – Select STAGE || View > Frame Selection.
    • – Playback the animation to see the motion.
    • Note: Opening the Graph Editor when the feet lHeelControl and rHeel Control are selected will see the animation channel with the keys set in the negative direction. This is the animation curve connecting the RotateZ of the foot to the Roll attribute. Remember roll is set to -3.
  2. Edit the Curve Tangents On the Feet
    • The curve tangent type should change so the steps cycle smoothly. The default tangent type is Clamped.
    • – Select Graph Editor || Tangents > Flat.
    • Note: The visual difference between clamped and flat tangents are subtle. Look at the start and end keyframes on the curves. The flat tangents will create a smooth hook-up for the cycle between start and end frame.
    • clamped:
    • flat:

Animate the Feet Up And Down

Key the vertical raising and lowering of the foot to show the stepping action.

  1. Turn On Auto Key for animating.
    • Use Auto Key to help in the raising of the feet. Auto Key will automatically  keyframe any attributes on the selected node that already have at least one keyframe, and for which the value is changing.
    • – Click on Auto Keyframe button on the right side of the Time Slider to turn it on.
    • – Open the Animation Preferences window: Click on the button just to the right of the Auto Keyframe button.
    • ANIMATION PREFERENCES (window) || Timeline > Playback Speed > Play Every Fame;
      • ANIMATION PREFERENCES (window) || Animation > Settings > Tangents > Default In Tangents > Flat;
      • ANIMATION PREFERENCES (window) || Animation > Settings > Tangents > Default Out Tangents > Flat;
      • This will set future tangents to flat.
      • – Click [SAVE];
  2. Raise The Right Foot at mid-step
    • Key the high point of the raised foot in the middle of a stride
    • – Go to frame 5.
    • – Select the rHeelControl.
    • – Translate the foot about 1 units up along the Y-axis.
    • This sets a new key for the Y-axis channel of the foot using Auto Key.
  3. Raise the left foot at mid-step
    • – Got to frame 15
    • – Select lHeelControl.
    • – Move the foot about  1 units up along the Y-axis.
    • Key is automatically set.
    • – Playback results
  4. Save
    • – 041712_14-Animation_03.ma

Animate the Pelvic Rotations

Create a more realistic action by setting the pelvis’ rotation and position to work with each step. Set keys for translation and rotation of the pelvis using Auto Key.

  1. Set the Pelvis Y rotation
    • Animate the pelvis rotation to give the walk a little more rotation.
    • – Go to frame 0;
    • – Select the pelvis node using its selection handle.
    • – Switch to top view. Rotate Pelvis using the rotation handle clockwise -10 degrees.
    • Note: This points the hips towards the left foot and right hip towards the right foot.
  2. Rotate the Pelvis in the opposite direction.
    • – Go to Frame 10
    • – Rotate the pelvis in the opposite direction by about 10 degrees.
  3. Copy a keyframe to another point in the timeline.
    • – Go to frame 0;
    • – In the Time Slider, MMB + DRAG to frame 20;
    • Notice: The display on the stage has not changed.
    • – With pelvis still selected, highlight the Rotate X attribute in the Channel Box, then RMB over the attribute and select > Key Selected.
    • Note: By doing so, you have set a keyframe on the rotate X value of the pelvis from frame 0 to 20.
    • – Refresh the Time Slider by dragging anywhere on the timeline.
    • Notice: The Rotate X has the same value at frame 20 and 0;
  4. Pelvis in Front View
    • – Go to frame 5;
    • – Front View: Rotate the pelvis on its Y-axis by about 4 degrees so that the right hip is rising with the right leg.
    • – Translate the pelvis X-axis: 1 units so the weight of the penguin is on the left leg.
    • – Go to frame 15
    • RotateY the pelvis on the opposite direction as the foot raises.
    • – TranslateX the pelvis so that the weight of the penguin is on the right foot.
  5. Edit the Keys for Creating Cycles
    • Prepare the file for creating cycles by verifying that the rotations match at the start and end cycle.
    • – Make sure the pelvis is selected.
    • – In the Graph Editor, CTRL + SELECT the TranslateX, RotateX, and RotateY attributes.
    • – Select GRAPH EDITOR || View > Frame All.

Add a Bounce To the Walk

Create a bounce to the walk by adding keyframes to TranslateY of the pelvis node.

  1. Edit The Pelvis Height
    • – GRAPH EDITOR: Highlight the pelvis.TranslateY channel.
  2. Insert Keys To the pelvis.TranslateYchannel
    • – Select the Insert Keys Tool found in the Graph Editor.
    • – Select the translateY curve, then with your MMB CLICK to insert a key at frame 5 and frame 15.
  3. Edit the Y translation value of the keys
    • – Press W to select the Move Key Tool.
    • – Select the new keys at frame 5 and 15 by holding down SHFT.
    • – CLICK + DRAG with MMB to move these keys to a value to add some bounce to the walk.
    • If you are on frame 5 or 15 you will see the effect it has on the character. Make sure the value you choose doesn’t hyper extend the leg.
    • – Press “a” to frame the curve.

Refine the Heel Rotation

Refine the animation of the foot rotations.

  1. Set a Key on the Left Foot’s Roll
    • Notice: The feet don’t pound on the ground after the heel contact.
    • – Select the lHeelControl using it’s selection handle.
    • – Go to frame 2;
    • – Set the lHeelControl Roll attribute to 0;
    • – Go to frame 5;
    • – Set lHeelControl’s Roll attribute to 0;
  2. Set a Key on the Right Foot’s Roll
    • – Select the rHeelControl using its selection Handle.
    • – Go to Frame 12
    • – Set the rHeelControl Roll: 0;
    • – Go to frame 15;
    • – Set the rHeelControl Roll: 0;
  3. Playback results
    • Leg animation is finished, but may notice the knees overextend between keyframes. In order to fix these snaps, try to fix the existing keyframe animations rather than adding new ones.
  4. Save
    • -041912_14-Animation_01.ma

Animate the Arm Swing

Animate the translation of the arm manipulators to be cycled in the animation.

  1. Set Keys for the Start Position
    • – Go to Frame 0;
    • – Show the geoLayer to see the character’s geometry;
    • – Move and rotate the lHandManip behind he body and low down.
    • – Move the lArmPv to bend the elbow to a good angle.
    • – Move and rotate the rHandManip in front of the body and up;
    • – Move the rArmPv to bend the elbow to a good angle
    • Note: Now the arms are opposite to how the feet are setup.
    • – Select the head joint and rotate it around the y-axis by about 9 degrees. This has the head always pointing straight forward.
    • 041912_14-Animation_02.ma
  2. Copy Keys for the End Position
    • In order to create a smooth transition for the arm cycle, you must have matching values at the start and end of your cycle.
    • – Select the lArmPv, rArmPv, lHandManip, and rHandManip nodes.
    • – MMB + DRAG the time slider to frame 20.
    • Note: Timeline will not scrub when the MMB is pressed.
    • – Highlight the translation and rotation attributes in the channel Box
    • – RMB in the Channel Box and select Key Selected  from the pop-up menu.
    • Note: This sets keyframes only on attributes you have selected in the Channel Box.
    • – Refresh the time slider.
    • Notice: The items you keyed are not following the penguin to frame 20. You will adjust that later.
    • Note: you can also use the Dope Sheet to copy and paste selected frames, or you can cut and paste keyframe values from the Graph Editor.
  3. Add to the Attributes.
    • – 041912_14-Animation_02.ma
    • you will need to offset the values already in the Translate Z attributes of the arm manipulators and pole vectors. Enter a mathematical expression in the attribute field to add or subtract to the existing value.
    • – Go to frame 20.
    • – With the lArmPv, rArmPv, lHandManip, rHandManip nodes selected, type +=30 in the translateZ attribute in the Channel Box, then Hit [ENTER].
    • Note: Doing so adds 30 units to your existing values for each attribute for each node.
  4. Set the Keys for the head Joint
    • – Select the head joint.
    • – MMB + DRAG the Time Slider from 0 to 20.
    • – Click on the head Rotate Y attribute in the Channel Box to highlight it.
    • – RMB in Channel Box and select Key Selected from the pop-up.
  5. Set Keys for the Middle Position
    • – Go to Frame 10
    • – Move the arm manipulators opposite to the legs.
    • – Rotate the head joint opposite to the hips.
  6. Keyframe the in-between.
    • – Set a good position for the arms at frame 5 and 15.
  7. Fix the Arm Manipulator Curves
    • – In the Graph Editor, select the arm manipulators Translate and Rotate attributes.
    • – Select all keyframes between frame 5 and 15
    • – Select GRAPH EDITOR || Tangents > Spline
  8. Delete the Static Channels
    • – If a curve in the Graph Editor is flat it’s whole length,it means the value doesn’t change over time. Static Channels slow Maya down, so delete them.
    • MAIN || Edit > Delete By Type > Static Channels.
  9. Turn off Auto Key.
  10. Save
    • – 042012_14-Animation_02.ma

 

Cycle The Animation

You’ve animated one full step. Create a complete walk cycle with the Graph Editor.

  1. Set Your Time Range
    • – Set the Start Time and Playback Start Time to 0.
    • – Set the End Time and Playback  End Time to 300.
  2. View all Curves in the Graph Editor
    • – Select MAIN || Window > Animation Editors > Graph Editor
    • – Select penguin from the Outliner to see all the curves in the Graph Editor.
  3. View the Cycle.
    • GRAPH EDITOR || View > Infinity.
    • – Select all the animation curves in the Graph Editor
    • GRAPH EDITOR || Curves > Pre Infinity > Cycle with Offset.
    • GRAPH EDITOR || Curves > Post Infinity > Cycle with Offset.
    • Note: Cycle with Offset appends the value of the last key to the first key in the animation curve.
    • – Play the animation.
    • Note: In order for this to work, the keyframes of the animation must match and add up correctly from start and finish of the walk cycle you are looping.
    • Note: The hand Manipulator tools must match the same distance from the pelvis on the first keyframe as it does on the last frame of the walk cycle.
  4. Adjust the Curves
    • – Zoom in on the curves and adjust the tangents so that the connection between the curves and cycle run smoothly.
    • – Select the keyframes on frame 0 and 20 in the Graph Editor.
    • GRAPH EDITOR || Tangents > Flat.
    • – Go to frame 300;
    • – At this frame you should see if there are any problems with your animation where objects seem to move further away from he group.
    • Note: The hand Manipulator tools must match the same distance from the pelvis on the first keyframe as it does on the last frame of the walk cycle.
    • – Fix any problems  in your cycle at either frame 0 or 20.
    • Note: You should not set a keyframe outside the cycle boundary otherwise you will break up the cycle.
    • – File 043012_14-Animation_01.ma

 

Bake the Keyframes

To use this animation in the Trax Editor, you will need to bake the keyframes of the post infinity onto the curves. Meaning: all the frames the post infinity created beyond your cycle animation,  will need to be created The Trax Editor cannot use post infinity curves from the Graph Editor, so you will need to generate the actual keyframes by baking them.

  1. Select the Penguin
    • – In the Graph Editor, select the penguin. You will have to select the individual items in the Graph Editor under penguin.
  2. Bake the Keyframes
    • Graph Editor || Curves > Bake Channel >
      • Bake Channel Options:
      • Time Range: Start/ End;
      • Start Time: 0;
      • End Time: 120;
      • Sample by: 5;
      • Keep Unbaked Keys: ON;
      • Sparse Curve Bake: On;
      • – Click [BAKE];
  3. Save.
    • -043012_14-Animation_02.ma

 

Create A Trax Clip File

The animation is finished. You’ll be working with Trax Editor later, so create a Trax Clip file for later use.

  1. Open The Trax Editor Window
    • – Select ANIMATION || Window > Animation Editors > Trax Editor
    • – Make sure the penguin character is set as current.
    • – Trax Editor || List > Auto Load Selected Characters.
    • – This is all you should see in the Trax Editor.
  2. Create a Clip
    • Trax Editor || Create > Animation Clip >
      • Animation Clip Options:
      • Name: Walk;
      • Leave Keys In Timeline: Off;
      • Clip: Put Clip in Trax Editor and Visor;
      • Time Range: Animation Curve;
      • Include Subcharacters in Clip: Off;
      • Create Time Warp Curve: Off;
      • Include Hierarchy: On;
      • – Click [CREATE CLIP];
    • – Press “a” to frame it all.
    • Note: A clip is created and placed in the Trax timeline. Another clip is also placed in the Visor.  Until you export the clip, it can only be accessed thru this scene file.
  3. Export the Clip from Trax Editor
    • TRAX EDITOR || File > Visor
    • – Select the Character Clips tab to see the clip source.
    • – Select walkSource clip.
    • RMB (on the clip) > Export.
    • Note: a popup will browse to the clips directory of our current project
    • – Export the clip as bigzWalkExport.
    • Note: Now you can import this clip into another scene. You will do this later.
    • – Close the Visor 
  4. Save
    • 043012_14-Animation_04.ma