Basic Relationships: Set-Driven Keys

A favorite feature for character riggers is the set-driven key (SDK). A set-driven key establishes a relationship for objects that lets you create controls that drive certain features of a character or an object in a scene.

Before you can use an SDK, you must create extra attributes and attach them to a character’s top node. These new attributes drive part of the character’s animation. The term character is used broadly here. For example, you can set up a vehicle so that an SDK turns its wheels.

Let’s start with a simple SDK relationship between two objects. You’ll create a relationship between a ball and a cone. As the ball moves up in the Y-axis, the cone spins in the X-axis. As the ball descends, the cone spins back. You’ll then revisit the hand and set up an SDK on the skeleton that animates the model.

Creating a Set-Driven Key

To create a simple SDK to make a sphere control the animation of a cone’s rotation, follow these steps:

Figure 9-58: Lay out a cone and a sphere.

f0958.tif

1. Create a NURBS sphere and a cone in a new scene. Move the cone to the side of the sphere, and lay it on its side, as shown in Figure 9-58.

2. Select the sphere, and in the Animation menu, choose Animate ⇒ Set Driven Key ⇒ Set. The Set Driven Key window opens with the nurbsSphere1 object selected in the lower half of the window (the Driven section). Its attributes are listed on the right, as you can see in Figure 9-59.

Figure 9-59: The Set Driven Key window

f0959.tif

3. You want the sphere to drive the animation of the cone, so you need to switch the sphere to be the driver and not what’s driven. Click the Load Driver button to list the sphere in the top half of the window.

4. Select the cone, and click the Load Driven button to display the cone’s attributes in the bottom half of the window.

5. In the Driver section, select the sphere’s translateY attribute. In the Driven section, select the cone’s RotateX attribute. Click the Key button to set an SDK that essentially says that when the sphere is on the ground (Y = 0), the cone’s X rotation is 0 because both attributes are currently 0. The cone’s RotateX attribute turns orange in the Channel Box, meaning a driven key has been set.

6. Select the sphere, and raise it in Y to a height of 5. Select the cone, and rotate it in X to 1800 to make it spin properly. Click the Key button in the Set Driven Key window to specify that when the sphere is at a height of 5, the cone’s RotateX attribute is 1800 degrees. As the sphere’s height increases from 0 to 5, the cone spins from 0 to 1800 in X.

An Advanced Set Driven Key: The Hand

Automating some animations on a character is indispensable to an animator. This can’t be truer than when setting up an SDK for hand control. After you model and bind a hand to a skeleton, you’re ready for an SDK.

cd.eps

Open the scene poly_hand_skeleton_v05.ma from the Poly_Hand_Anim project on the CD, or use your own file that has the hand and its skeleton and is bound (either smooth or rigid) to the skin. Your file shouldn’t have animation, though. Set your hand to the bind pose before you begin.

Creating a New Attribute

First, you’ll create a new attribute called index_pull to control a contracting finger:

Figure 9-60: The Add Attribute window

f0960.tif

1. Select the hand. (It’s best to select the top node handTopNode instead of just the poly mesh of the hand.) In the handTopNode tab of the Attribute Editor, click the Extra Attributes section. For now, at least, this section is empty.

2. In the Attribute Editor menu, choose Attributes ⇒ Add Attributes to open the Add Attribute window, which is shown in Figure 9-60. In the Long Name field, enter index_pull. Maya will automatically display that attribute as “Index Pull” in the UI. Make sure the Make Attribute Keyable check box is checked and that the Float option is selected in the Data Type section. In the Numeric Attribute Properties section, set Minimum to 0, set Maximum to 10, and set Default to 0. Click OK.

After you click OK, the Index_Pull slider appears in the Attribute Editor and the Channel Box. This attribute alone will control the entire index finger.

Assigning the Set Driven Key

To set up the relationships with the SDK, follow these steps:

Figure 9-61: The Set Driven Key window for the hand

f0961.tif

1. With the top hand node selected, open the Set Driven Key window (choose Animate ⇒ Set Driven Key ⇒ Set). Click Load Driver to specify that the hand should drive the animation.

2. Because you’re animating the index finger pulling back, you want to drive the rotations of the top three knuckles. Shift+click all three knuckles on the index finger. Click the Load Driven button. All three knuckles appear on the bottom.

3. Select the hand’s Index Pull attribute and the three knuckles’ RotateY attributes, as shown in Figure 9-61.

4. With the rotations of the knuckles at 0 and the index_pull attribute at 0 as well, click the Key button to set the first relationship. When index_pull is at 0, the finger is extended.

5. Select the top hand node, and set the index_pull attribute to 5.

Figure 9-62: The bent index finger

f0962.tif

6. Select the fingertip’s knuckle (joint11 in the CD file), and rotate it in Y to 20. Select the next joint up the chain (the middle knuckle, joint10), and rotate it to 35 in the Y-axis. Select the final index knuckle (joint9), and rotate it in the Y-axis to 5. Click the Key button. When the index_pull attribute is at 5, the finger assumes this bent position.

7. Select the top hand node, and set index_pull to 10.

8. Select each of the three knuckles. Set the tip to rotate to 65 in Y. Set the middle knuckle to 60. Set the last knuckle to 50. Click the Key button to see the result shown in Figure 9-62.

Select the top hand node, and change the value of the index_pull attribute to animate your finger. All you need to do to pull the finger is to set keys on that attribute, without having to rotate the knuckles constantly. Furthermore, you can set up a single SDK to control the bending of all the fingers at once, or you can set up one SDK for each finger for more control.

cd.eps

Open the scene poly_hand_skeleton_v06.ma from the Poly_Hand_Anim project on the CD to see the hand with the SDK set up on the index finger.

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

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