Set Driven Key
Basics

Set Driven Key (SDK) is a very, very powerful tool for animation. It allows you to have an object react to the actions of another object automatically, without having to actually key it in the animation. The limits of SDK are only limited by the user's imagination!

There are many different aspects of SDK that can form different effects in animation. The two main ones are Object to Object SDK and Control to Object SDK.

OBJECT TO OBJECT SDK ANIMATION

A common use of SDK animation is to have the actions of one object affect the actions of another. For example, say you have a scene with a spaceship returning to base. You can use SDK to the effect of the spaceship's nearing the hangar doors automatically cause the doors to open. In Figure 1, I have my scene. It's just a simple space ship and a hangar with two doors I will want to slide open to allow my ship to fly in.Figure 1
Open the Set Driven Key options (Figure 2, [Animation] Animate > Set Driven Key > Set > Options). This window is composed of the Driver and Driven sections. As you can see in the picture, I have the spaceship in the Driver Section and the two hangar doors in the driven section. In order to do this, select the spaceship and click the "Load Driver" button. Then, select the two doors and click the "Load Driven" button. For this scene, the movement of the spaceship toward the hangar in the X Axis is going to cause the doors to open, each of them sliding in the Z Axis. Select these channels in the Set Driven Key window.Figure 2
Position the spaceship where you want it to be when the doors begin to open and press the "Key" button in the SDK window.Next, as in Figure 3, position the spaceship inside the hangar and move the doors open and again press the "Key" button. Figure 3
Now, you should notice that whenever you move the ship into that range of space, the doors open and close.
CONTROL TO OBJECT SDK ANIMATION

Another common use of SDK is to have a custom channel attribute control the movement of another object. For example, to extend a mechanical arm, you could use a Locator like a "remote control." For this lesson, download the scene file HERE (locator.mb, 80k).
In Figure 4, you see my scene: a mechanical arm with a gun attached to the end. The arm is in 3 segments seperated by cylindrical "joints." Figure 4
Create a locator and place it near the arm (Create > Locator). With the Locator selected, open the Channel Control (Figure 5, Window > General Editors > Channel Control).Figure 5
In the Channel Control, you'll see two sections: Keyable and Non-Keyable. Select all of the Locator's channels and click on the Move>> button. It'll put all of the channels into the Non-Keyable section. Next, with the Locator still selected, add a custom attribute (Modify > Add Attribute). As in Figure 6, in the Add Attribute window, give the Attribute a name. I used "Extend." Make sure Make Attribute Keyable is checked and the Data Type is "Float." In the Min, Max, and Default values, put 0, 10, and 0. This makes the attribute only range between 0 and 10 with 0 being the default starting point. Click "OK."Figure 6
As in Figure 7, you should have only the Extend attribute in you Channel Box for the Locator.Figure 7
Now, for the scene you downloaded, I've already taken the liberty to create a hierarchy for the gun arm (Figure 8). Rotating Join1 will rotate the entire arm, rotating Joint2 will only rotate that portion of the arm, and so on. Now, let's set up the SDK for the extend. In the SDK window ([Animation] Animate > Set Driven Key > Set > Options), load the locator as Driver and Joint1, Joint2, and Joint3 as Driven. In the SDK channel display (Figure 9), select "Extend" for the locator, and for all 3 joints, select Rotate Z. With the Extend attribute at 0 and all of the Rotate Z attributes of the gun at their original position, click the "Key" button.Figure 8Figure 9
Now, raise the Extend attribute for the locator to 10 and rotate each joint on the Z Axis to the position you want the gun to extend to (Figure 10). Click the Key button.Figure 10
If everything was done correctly, then as you slide the Locator attribute from 0-10, the arm will extend.
I hope this tutorial has opened you up to the possibilities that Set Driven Key can perform for your projects. If you have any questions, suggestions, or comments, please contact me.

Michael McKinley