© Purushothaman Raju 2019
P. RajuCharacter Rigging and Advanced Animation https://doi.org/10.1007/978-1-4842-5037-2_3

3. Advanced Animation Tools

Purushothaman Raju1 
(1)
Bangalore, Karnataka, India
 

In the previous chapters, we learned about the principles of animation and how to create animation within 3ds Max. We learned how to tweak our animations using animation editors such as the Curve Editor and the Dope Sheet. In this chapter, we look at using advanced animation tools to animate in a desired and procedural way. We look at animations using constraints and controllers as well. We begin by setting up hierarchy, pivots, and layers to geometric objects and then move into learning and using various types of constraints for advanced animation.

Getting Started with Hierarchy

To begin, let’s look at what hierarchy is. Hierarchy is a software technique used to create parent/child relationships. Hierarchies ease the workload of an animator. For example, when you lift your thigh up, your knee, ankle, and feet bones also rise up because they are linked to each other. Without this hierarchy, the animator would need to animate all the bone parts individually. Follow along and you will understand this better as I guide you through an example.

Setting Up a Hierarchy

Hierarchy for objects/geometries needs to be set up before you begin any animation that has multiple parts. As an example, load Hierarchy_Start.max from the source files folder. A simple robotic arm has been created with basic primitive shapes (probably not the best modeling you have seen, but this should suffice for now). See Figure 3-1. At this point, see if you can move the robotic arm from its default pose to a different pose.
../images/477189_1_En_3_Chapter/477189_1_En_3_Fig1_HTML.jpg
Figure 3-1

Simple robotic arm setup

If you try to pose the arm in a different way, you will notice that the arm is made of multiple parts. That means that posing it is tedious. Now go ahead and swivel the arm 360 degrees on its base or have the claw pick up and play the animation. This is tough and you might end with animations where the parts move away from each other. The purpose of this section is to show how to address these problems.

Reset your workspace by selecting standard design so that the Scene Explorer is docked on the left view. Alternatively, you can open Scene Explorer by choosing Tools menu ➤ All Global Explorers ➤ Scene Explorer. (Refer to Figure 3-2.)
../images/477189_1_En_3_Chapter/477189_1_En_3_Fig2_HTML.jpg
Figure 3-2

Scene Explorer menu

Once you open the Scene Explorer, you should see the Scene Explorer panel with the hierarchy of the robotic arm, as shown in Figure 3-3.
../images/477189_1_En_3_Chapter/477189_1_En_3_Fig3_HTML.jpg
Figure 3-3

Scene Explorer panel

Once the Scene Explorer is open, you can see that there are many primitive shapes that make up the robotic arm. As you can see, my naming conventions for mesh are nonexistent and this is for a reason. To rename the primitives, select one in the Scene Explorer, right-click, and choose the Rename option. Once you have given it an appropriate name, save it and proceed.

If you look before each primitive name, there is an eye icon that toggles the visibility of the object and a snowflake icon on the right, which freezes the mesh but leaves visibility so that you don’t accidently select it in the viewport. As you can see, except for the segment in pink, every other primitive is frozen and the claws are set to invisible (note the eye icon).

The leftmost column shows the switches used to toggle the visibility of objects based on type (see Figure 3-4).
../images/477189_1_En_3_Chapter/477189_1_En_3_Fig4_HTML.jpg
Figure 3-4

Scene Explorer: visibility and frozen toggles

Once you have renamed the files the way you want, you need to set up a hierarchy so that rotating sphere001 reorients all the others as well. Hierarchy can be set by dragging objects and dropping them below the one you want them to be a child of. In essence, the topmost object is the parent and the ones under it are the children.

Load Hierarchy_Structured.max and see what I have set up. Note that box002 and box003 are children of box001. Use the Rotate tool from the toolbar or press E shortcut for rotate and try rotating any joints. You should see that the children follow their parent’s rotation. By dragging and dropping items in the Scene Explorer, we have set up hierarchy so that animating this hand is a lot easier. We should be able to pose and animate the robotic arm in a much easier way. See Figure 3-5.
../images/477189_1_En_3_Chapter/477189_1_En_3_Fig5_HTML.jpg
Figure 3-5

Object rotated using rotation tool

Go ahead and animate the hand by trying to pick an imaginary object. You will notice that the claws won’t rotate to give the crab-claw kind of motion.

Objects rotate around their pivot and a pivot by default is located at the center of the mass of an object, but this can be relocated as needed. Spheres have the pivot in the center by default, as they are symmetrical on all axes. The box in its current state cannot be animated like a claw hand since it needs to have the pivot at the base for it to have a claw motion. How do we fix this?

Setting Up a Pivot

When you select the claws that make up box002 or box003, you’ll notice that the pivots are in the center. We need to change them to the base so that the clawing motion can be achieved.

Notice the claw and the rotation pivot in the middle. Open the hierarchy panel open by clicking on the Hierarchy tab from the control panel. See Figure 3-6.
../images/477189_1_En_3_Chapter/477189_1_En_3_Fig6_HTML.jpg
Figure 3-6

Command panel: Hierarchy tab

Clicking on the Hierarchy tab from the command panel will populate the tab with hierarchy data and give us options to tweak to our liking. See Figure 3-7.
../images/477189_1_En_3_Chapter/477189_1_En_3_Fig7_HTML.jpg
Figure 3-7

Hierarchy tab options

Once you have selected the object box002 and have the Hierarchy panel open, choose Affect Pivots Only from the Hierarchy tab (see Figure 3-8). You will be able to reposition the pivot to the desired location.
../images/477189_1_En_3_Chapter/477189_1_En_3_Fig8_HTML.jpg
Figure 3-8

Viewport pivot repositioning, before

In this case, I recommend you go to the top viewport and orient it, as shown in Figure 3-9, for both claws.
../images/477189_1_En_3_Chapter/477189_1_En_3_Fig9_HTML.jpg
Figure 3-9

Viewport pivot repositioning, after

Once the pivots are set, click on the Affect Pivot Only button to exit pivot editing mode and rotate the claws. Voila! The animation works correctly. Load the Hierarchy_StructuredwithPivots.max file. Animate and experiment.

Note

Keep in mind that all the animation keys you create can be tweaked in the Graph Editor for smooth motion.

Constraints

Constraints allow us to animate an object’s transformations to another object based on the type of constraint used. There are a couple of constraint options available in the menu. Choose Animation ➤ Constraints. Let’s look at each one and see how we they function and help us with animation. See Figure 3-10.
../images/477189_1_En_3_Chapter/477189_1_En_3_Fig10_HTML.jpg
Figure 3-10

Constraints menu

Attachment Constraint

The Attachment constraint is used to attach one object to another. With this constraint, we can animate a relationship. Let’s load the roboticarm_start.max file and animate it to pick up a ball. Follow these steps:
  1. 1.

    Create a box named helper from the Create tab on the command panel. It’s located on the right side of the screen. Position the helper box where the ball will be held.

     
  2. 2.

    In the Scene Explorer make the helper a child of box001 so that box002 and box003 are children of the dummy. (A checkpoint file has been created called Roboticarm_helper.max.)

     
  3. 3.

    Animate the robotic arm in a way so that, at frame 30, it reaches the ball on the ground and, at frame 70, it goes to a different position.

     
  4. 4.

    Play the animation and refine the keys as applicable (reference the checkpoint file called Roboticarm_Keyframed.max).

     

If we are not using the constraint, we would animate the ball to match the movement of the arm, but if someone were to change the arm’s animation path, the ball would need tweaking as well. The Attachment constraint comes to our rescue here.

Let’s have the robotic arm pick up the ball and place it on the table.
  1. 1.

    Select the ball that needs to move with the arm and choose Constraints and Attachment constraint from the Animation menu. Your cursor will change to a ribbon dotted line. The software waits for you tell it what object it is attached to, with the ribbon line clicked on the helper box that we created. See Figure 3-11.

     
  2. 2.
    Once you choose the Attachment constraint, the ball moves to the helper object and sticks there. This is not what we want. We want the ball to be picked up and placed. We need one more step to achieve that effect.
    ../images/477189_1_En_3_Chapter/477189_1_En_3_Fig11_HTML.jpg
    Figure 3-11

    Constraint wiring, ball to helper

    With the ball still selected, go to the motion panel in the control panel. See Figure 3-12.
    ../images/477189_1_En_3_Chapter/477189_1_En_3_Fig12_HTML.jpg
    Figure 3-12

    Motion panel

     
  3. 3.

    Select the Attachment constraint in the position list pane of the motion panel and animate the weight so that it is 0 from frames 0 to 29 and set to 100 at frame 30. Weight can be locked by turning on the auto key and changing the value to 0 at frame 0. At frame 29, change the value to 1 and 0 back again so that a key is created. At frame 30, change the weight value to 100.

     
  4. 4.
    You might notice the ball moving from frame 0 to frame 29 in an unexpected way, as seen in the checkpoint file called RoboticArm_Attachment_Constraint_Curve.max. Open the Curve Editor and set both keys to linear for the weight for frame 0 and 29 and that should fix it. See Figure 3-13.
    ../images/477189_1_En_3_Chapter/477189_1_En_3_Fig13_HTML.jpg
    Figure 3-13

    Graph of ball before keys are set to linear

     
  5. 5.

    Tweak the graph as shown in Figure 3-14 by setting the keys 0 and 29 to linear. Then play the animation.

     
../images/477189_1_En_3_Chapter/477189_1_En_3_Fig14_HTML.jpg
Figure 3-14

Graph of ball after keys are set to linear

Taking this a step ahead, if you want the robotic arm to place the ball on the box named table, you need to add another Attachment constraint to the sphere and choose the table. Animate the weight to 100 only when the ball needs to be kept on the table. The same technique can be applied to character animation, when a character has to pick up and place something.

Surface Constraint

The Surface constraint is used when you want to conform an object to stick to the surface of another object. This constraint works only for parametric objects, thus limiting the scope of how we can use them freely.

Here’s a simple example to show you how it works. Load surfaceconstraints.max.
  1. 1.

    Select the cylinder and choose Animation ➤ Constraints ➤ Surface Constraints and then select the sphere.

     
  2. 2.

    In the motion panel, go below to the surface controller parameter and use the U and V sliders to manipulate the cylinder on the sphere geometry. See Figure 3-15.

     
../images/477189_1_En_3_Chapter/477189_1_En_3_Fig15_HTML.jpg
Figure 3-15

Surface constraints, motion options

Reference the SurfaceConstraintComplete.max file, which has been provided in the source folder.

Path Constraint

The Path constraint is used when you want an object to follow along a specific path. It not only allows the object to follow the path, but also orients and tilts it according to the change in the path’s direction. A typical example is to have a skater move along the path and then later manually animate his hands for balance based on twist and turns.

  1. 1.

    Open the pathconstarint_Start.max file.

     
  2. 2.

    A teapot and a line drawn through shape tools are the only two objects.

     
  3. 3.
    Select the teapot and choose Animation ➤ Constraints and Path Constraint. See Figure 3-16.
    ../images/477189_1_En_3_Chapter/477189_1_En_3_Fig16_HTML.jpg
    Figure 3-16

    Path constraint

     
  4. 4.

    The Path constraint puts the object at the beginning of the line. The amount of distance the object covers is based on the percentage along the path.

     
  5. 5.

    Orient and Bank allow the object to face the path’s direction and lean in on the curves as the object turns.

     
  6. 6.

    Loop keeps looping on the path if that is the kind of animation we seek.

     

Another typical example is to animate a bird flapping its wings endlessly and then put it on a path to fly.

Position Constraint

When you apply the Position constraint for object A to object B, the position of A is locked to B. That means you can no longer change the position of A manually. If you move object B, object A will move along.

Load the positionconstraint.max file:
  1. 1.

    If you notice, we have three objects in the scene: two boxes and a sphere.

     
  2. 2.

    Select the sphere and choose Animation ➤ Constraint ➤ Position Constraint.

     
  3. 3.

    With the wiring enabled, select one of the cubes.

     
  4. 4.

    Your sphere now immediately moves to the cube’s location.

     
  5. 5.

    Go into the sphere’s motion panel and choose Keep Initial Offset. This keeps the sphere where it is.

     
  6. 6.

    Now try moving the sphere using the Move tool. It is locked in position, as it is deriving its position from another object.

     
  7. 7.

    Select the sphere again and choose the Position constraint. Choose the other cube. When you have more than one position controller applied, you can control the weight. Play around with the values to see how we can influence the sphere’s position by moving the two cube geometries in the scene.

     
  8. 8.

    Note that the sphere can be rotated and scaled regardless of the position of the cubes. See Figure 3-17.

     
../images/477189_1_En_3_Chapter/477189_1_En_3_Fig17_HTML.jpg
Figure 3-17

Position constraint motion panel

Reference file Positionconstarint_Complete.max is available in the source files folder.

Link Constraint

The Link constraint allows you to dynamically change the parent as and when needed. The Link constraint works like the Attachment constraint, but with the addition of having the parent/child relationship animated, which is not available otherwise.

If you look back at the previous section where we discussed the Attachment constraint, we had the robot pick up the ball and move it. If we were to have another robot receive the ball, we would need the Link constraint. The Link constraint lets you animate the link.

Load LinkConstraint_Start.max and play the animation to see what we have. Notice we have two boxes and a sphere, and everything is animated.

I want you to pay attention to the way they are positioned. Note at frame 15 that box001 and the sphere come into contact and the ball and sphere move in their animated direction. At frame 24, we have both boxes converging and moving on after that frame.

The Link constraint enables us, at frame 15, to make the ball begin moving along with the green box. At frame 24, the ball will begin moving with box002. We also want the sphere to stop following any box after frame 46 (this is the frame where box002 comes back). Follow these steps:
  1. 1.

    Select the sphere and choose the Animation ➤ Constraints ➤ Link Constraint menu option.

     
  2. 2.

    Select any box. It doesn’t matter at this point; you just need two objects to create a link constraint.

     
  3. 3.
    Once you’ve established a link, select the sphere, go to the motion options, and delete the link by selecting the Link Params from the motion panel and clicking on the Delete Link button. See Figure 3-18.
    ../images/477189_1_En_3_Chapter/477189_1_En_3_Fig18_HTML.jpg
    Figure 3-18

    Link constraint, Delete Link motion panel

     
  4. 4.

    Once you have deleted the link, ensure you are in frame 0 and click on Link to World.

     
  5. 5.

    Move to frame 15 and click Add Link. Then choose box001.

     
  6. 6.

    Move to frame 24 and click on Add Link. Choose box002.

     
  7. 7.
    Finally at frame 46, click on Link to World again. Link Params in the motion panel will look like Figure 3-19.
    ../images/477189_1_En_3_Chapter/477189_1_En_3_Fig19_HTML.jpg
    Figure 3-19

    Dynamic linking over time with the Link constraint

     
  8. 8.

    Now play back the animation and see how the sphere moves.

     

We used the Link constraint to create a dynamic parent for the sphere at various points of time. This was not possible otherwise. A checkpoint reference file is created for you to preview called LinkConstraint_Completed.max.

LookAt Constraint

The LookAt constraint creates quick and efficient eye rigs for characters. The object is oriented along the axis of the target. This is done by locking an axis to always face the target.

Load 3ds Max and open Lookatconstraint_Start.max. Then follow these steps:
  1. 1.

    The scene file is pretty simple. We have two eye-shaped primitives and a target box.

     
  2. 2.

    Select one eye and choose Animation ➤ Constraint ➤ LookAt Constraint.

     
  3. 3.

    Choose the target box.

     
  4. 4.

    At this point, the sphere might reorient itself. Nothing to worry about, as we will fix that.

     
  5. 5.

    Repeat the steps on the other eye.

     
  6. 6.
    You should see a line drawn from the eyes to the target, as shown in Figure 3-20.
    ../images/477189_1_En_3_Chapter/477189_1_En_3_Fig20_HTML.jpg
    Figure 3-20

    Link constraint for a pair of eyes

     
  7. 7.

    Now select one sphere and go into the motion options.

     
  8. 8.

    In the PRS parameter rollout, click on the rotation button. PRS rollout stands for position, rotation, and scale.

     
  9. 9.

    With rotation clicked, you should see the LookAt constraint rollout right below the Rotation list.

     
  10. 10.
    Choose the LookAt constraint and set Keep Initial Offset to on. That should bring the eye back to its original rotation. See Figure 3-21.
    ../images/477189_1_En_3_Chapter/477189_1_En_3_Fig21_HTML.jpg
    Figure 3-21

    LookAt constraint, initial offset toggle

     
  11. 11.

    If you move the box now, you will see that the eye tracks the object.

     

This technique can be used for anything that needs to track another object, such as a surface to air missile launcher tracking a fighter jet in the air, or a predator keeping its prey in sight. A checkpoint file called Lookatconstraint_Finish.max has been created for you to see the final result.

Orientation Constraint

The Orientation constraint is similar to the Position constraint. The difference is that the Orientation constraint will lock the rotation of the object, although the object can be scaled or repositioned. Having multiple Orientation constraints allows for average rotations applied based on the weight of each target.

A typical use case for this constraint would be for window blinds. Instead of manually animating each blind, a single main object can be animated and other pieces that make the windows blind can replicate the rotation.

Load OrientationConstraint_Start.max. If you notice in the file, I did a rough modeling of a window frame and 22 boxes to emulate them as window blinds. I also created a box called control.
  1. 1.

    Select all the objects that are blinds.

     
  2. 2.

    Go to the Animation menu and choose Constraints ➤ Orientation Constraint and choose the control.

     
  3. 3.

    If you rotate the control now, you will notice that the blinds rotate as well.

     

We used the Orientation control to rotate the window blinds. This will save a lot of time, when you don’t want to select each one and rotate. Position and scale are not locked in this constraint, so you are free to manipulate them. (The OrientationConstraint_finish.max file has been added for your reference.)

We will use all these constraints to develop character animation in the upcoming chapters. In the next chapter, we look at wire parameters and advanced controllers.

Engine: Mechanical Animation Using Constraints

Let’s now create a piston animation of an engine using constraints.
  1. 1.

    Load MechanicalMotion_Engine_Start.max and observe the geometry and see how each pivot rotates.

     
  2. 2.

    Let’s set up a simple animation for the Crankshaft, as this rotation will drive other animations. Turn on the auto key and, at the end frame, give it a few rotations.

     
  3. 3.

    Play the animation. Only your crankshaft will be rotating at this point.

     
  4. 4.

    Make the Crankshaft_Connector a child of the crankshaft. If you play the animation now, the Crankshaft_Connector will rotate along.

     
  5. 5.

    Select the Connecting_Arm and make it a child of the crankshaft. Rotating the crankshaft now will rotate the connecting arm as well. But we have a problem. The connecting arm is supposed to always face the direction of the piston. Let’s fix this issue.

     
  6. 6.

    Select the Connecting_Arm and go to the Animation menu. Choose Constraints ➤ LookAt Constraints and choose the piston the arm will look at in the other axis.

     
  7. 7.

    The arm will look in a different direction. With the Connecting_Arm selected, go to the motion panel, PRS parameters, and ensure you have Rotation selected. With Rotation selected, you should see a LookAt constraint rollout.

     
  8. 8.

    In the LookAt constraint rollout, choose the Z axis, as the object needs to point up in the Z space. The object should revert to its initial position.

     
  9. 9.

    Play the animation now. You should see the Connecting_Arm point at the piston.

     
For the next challenge, we need the piston to move up and down as the arm goes up and down. We are going to use helpers to restrict the movement of the piston so it can’t move sideways.
  1. 1.

    From the command panel, go to Create ➤ Helpers ➤ Standard and create a dummy. A dummy is nothing but a null; it’s simply an tool that cannot be rendered.

     
  2. 2.

    Align the newly created dummy to the pivot of Connecting_Arm.

     
  3. 3.

    Select the newly created dummy and make it a child of crankshaft. Play the animation. You should see the dummy rotating along with the crankshaft.

     
  4. 4.
    Ensure you are at frame 0 and select the dummy. With the dummy selected, go to the Hierarchy tab in the control panel and choose the Link Info tab. See Figure 3-22.
    ../images/477189_1_En_3_Chapter/477189_1_En_3_Fig22_HTML.jpg
    Figure 3-22

    The Link Info tab

     
  5. 5.

    In the Link Info tab of the dummy, we want the dummy to use the parents’ Z position only. By default, all the options will be checked in the Inherit section, which would mean that the object would follow along on all axes in position, rotation, and scale. Check only the Z axis of Move. Uncheck everything else. Now the link will work only on the Z axis of Move. This makes the current object follow the parent only on the Z axis. Play the animation to see the result.

     
  6. 6.

    We need to move the piston up and down as the crankshaft rotates. To do this, make the piston a child of Piston_Connector.

     
  7. 7.

    Select the Piston_Connector and make it a child of the dummy that we created. Voila! We have a working engine mockup ready.

     

A checkpoint file up to this point has been saved for your reference at MechanicalMotion_Engine_Complete.max. Load it and see if you are running into any difficulties.

Summary

In this chapter, we learned about setting hierarchy and about the various types of constraints available. In the upcoming chapters, we use these constraints to drive character rigs for animation.

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

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