'Maya'

 
'Using driven keys to create a handController' by Martin Andersson


This task is not very complicated, but it's a tool in Maya you DEFINITIVELY should not miss! Seriously! You have probably downloaded several free rigs on the Internet and all of them have controls controlling other controls. Usually NURBS-curves or locators are used, but you can use just about anything as controllers. Whatever you choose to use, you want the user to be able to handle the rig without difficulties. Animators do not want to manipulate joints. They want controllers to drag around in the viewport. Actually, they usually don't care much about whats beneath the surface at all. They won't relate to it when animating. Make sure you have total control and avoid using floatSliders. About the sliders: This is a personal opinion, but using floatSliders make is so much harder for the animator to get accurate results. This is very easy to achieve using the channelBox. The channelBox is comfortable to work with because you can type in numbers directly, select attributes and use the MMB ( middle mouse button ) to drag values and while holding Ctrl while dragging you can set the value divided by five.

Let's get familiar with the channelControl then

  1. Create a pCube (polygon cube ) and name it something clever ( or don't bother to rename it at all )
  2. Open the channelControl ( Window General Editors Channel Control )

As usual numbered images are clickable for larger view. Some other images are also clickable and if they are I will write a little note next to it.


1 - Get familiar with the channelControl. By default Maya
only shows rotate, translate, scale and visibility. This doesn't mean that there are no other attributes, they're just hidden. You can choose to add these hidden attributes to your objects using the channelControl. In Maya 7.0 you can also choose to display these attributes as keyable or non-keyable.

Say you want to show the attribute "rotatePivotTranslateY" in pSomethingClever's channel-Box. Simply scroll down and find it, then you click the "<<Move" button to make it keyable or the "Move>>" button to make it non-keyable.

You can also hide rotate, translate, scale or visibility. Just choose the ones you want to hide and click "Move>>". You have now set the selected attribute to "Non-keyable hidden" .If you hid scaleY, this will still be affected if you press "s" to set key after using the scaleTool directly. However you will not be able to set a key on this attribute directly in the channelBox.

You can also use the right mouse button with the
attribute selected to hide the attribute and other
similar options you should look into.

Click for larger image

Before we go any further I'd like to go through how driven keys work. The secret lies in the name really. An attribute will control another one based on keyed positions.

Let's do an example together and I'll walk you through the steps. We're going to let the translate of a cube control the rotate of a cone.

  1. create a pCube and a pCone and rename the cube "pCubeDriver" and the cone
    "pConeDriven".
  2. Open the "Set Driven Key Window" ( Animate Set Driven Key Set ) Make sure you are in the
    animation menu. ( F2 ) You will not find the animation drop-down menu if you are in another mode.



    The Set Driven Key Window should now be opened.
  3. Select pCubeDriver and Click "Load Driver". Then select pConeDriven and click "Load Driven".

2 - Now that we have them both loaded in the "Set Driven Key" window, we can go to work.

I want the cube to translate from translateZ = -10 to
translateZ = 10 and I want the cone to rotate from
rotateZ = -90 to rotateZ = 90.

When the cube is in origo ( translateZ = 0 ) I also want the cone to stay still. Therefore we need a key to
determine the neutral position.

Select pCubeDriver and its translateZ (inside the "Set Driven Key" Window ) Click image below for
explaination: and hit the "key" button.

Click for larger image
Click for larger image

3 - Notice that the pConeDriven.rotateZ attribute in the channelBox has turned red. This indicates that this attribute has been keyed. Maya uses colorCodes to indicate different things. An expression will go purple and if your attribute has multiple connections
it will turn yellow.

OK, we have set the neutral position now. Let's set the other two.

Select pCubeDriver and set its translateZ to -10,
select pConeDriven and set its rotateZ to -90.
(Even though the attribute is keyed earlier doesn't
mean we can't set other values here. Since the
pCubeDriver.translateZ has changed we can set
a new value and therefore get an animation here. If
pCubeDriver.translateZ was still at 0 we would have
overwritten the neutral position of the cone to -90)

If you want to test your driven keys now simply drag
the cube between translateZ 0 and translateZ -10
You should see the cone rotate.

 

Click for larger image

4 - Now we have to set a key at pCube.translateZ 10 to complete the task. Select the cube and set the translateZ value to 10. Select the cone and set the rotateZ value to 90.

Hit "key"

Now we have done it basically. If you drag the cube back and forth you will see the cone rotating. But you'll also notice that if you drag it further than -10 or 10 nothing happens to the cone. There's no point in letting the animators be able to drag it further.

Select the cube and press "Ctrl+a" to open the
attributeEditor. With the pCubeDriver-Tab selected
scroll down to Limit Information and open the translate frame. Here you set the Trans Limit Z to -10 for Min and 10 for Max. Now you won't be able to drag it any further than the values we just set.

 

 

Click for larger image