by date
Maya tutorial set driven keys
Maya tutorial set driven keys
| Name: | Affectworks | |
|---|---|---|
| Date Posted: | Jul 24, 2007 | |
| Rating: | Not Rated | |
| Public: | YES | |
| Comments: | YES | |
| RSS Feed: | or Subscribe with . | |
| Profile Page: | View profile page for Affectworks |
Blog post
Edit: Well, it seems our server went crash. I hope you can figure things out without the images. I'll see if I can find another host for the images tonight.
Edit2: Found a more reliable server.
I know I am in the minority in this community since I use Maya, but the few of us that are still using it might find some interest in this article / tutorial.
Set driven keys. What can't they do? They're like little magic fairy helpers that run in the background and do awesome magic fairy stuff, that's what they do!
So what is a set driven key? Basically it's a little expression that tells object A to do B when object Y does Z. Ok. cool. But what can be done with it? Well, since I am mostly a character animator I use it for tons of little fiddly things such as hands, toes and such to all be controlled by one single controller. Nice, yeah?
I'll go through how I setup one hand of a character of mine and then you should have the basic concept down of how to use it for other things. Best of all... it works perfectly with Torque (since the exporter only looks positions of objects and not HOW things got to where they were).
Let's get started!
Here's a screenshot of a character.

Cool? We are only interested in the hands at this time, so let's take a closer look.

The hand controller (a simple nurbs curve which is culled out in the "NeverExport:" part of the dtsScene.cfg file at the time of export) is parented to the wrist node so that when we move things it follows along nicely. I use an align script to make sure that the controller is situated perfectly along the bones.
I hide the mesh since it's not important to this tutorial.
Let's get busy!

Select your hand controller and in your Channels box drop down box, (see screenshot) select Add Attribute. A new window will open up. so what's this, you ask? This is a place where you can add your own custom attributes that works exactly like Translate, Rotate, Scale that you already have in your channel box. The thing is that just adding these new attributes / channels won't do squat for you. You have to tell Maya what these new attributes actually do.
But I digress. Let's push on!

This screenshot shows you the important bits. First off, you need a name for your new attribute. Since I am old and easily forget things I like to name them things that make sense. So this new attribute will be the thumb wigglifier.
Next up is what type of attribute it is. Leave it at float (for you non programmy people there, let your eyes gloss over and continue down to the next paragraph) so we can have the attribute have values like 2.3569. Mmmm... such tasty decimals.
Next up you need a min value (starting position) and max value (ending position). I like using 0 - 10, but you can set whatever number you want in here. Finally, the default value should be the same as your min value. click Add and you have a new keyable attribute! Horraay!!

Now repeat this process with the rest of the fingers. As you can see, my character only has three fingers so I need two more attributes; index and middle. I use the exact same values as the thumb attribute.

Now we can get to what I said this tutorial was about. Set driven keys, baby!
What we want to do is to have a controller that not only controls the IK of the arm, but also controls the finger wiggling. You know.. so our character can pick his nose or whatever.
In the Animation section of Maya (F2), you'll want to click here:

This will open up a empty looking window and if you, like me, had the hand controller selected it will be defaulted to be the driven. We don't want that, so with the controller selected click "Load Driver". What this does is tell Maya that this object, in fact, is what will control the other objects. Your window will look something like this now:

Now we want to tell it what this controller will be driving! So select each of your finger bones and work your way up to the knuckle. I have three bones in each finger. I'll start with the middle finger and with those selected click "Set Driven" in your set driven window.

Ok! Cool. We now have a driver and something it drives (driven objects). Now select both the controller and the three (for you it may be more) bones and you'll see that in the right hand side of the Set Driven Key window the attributes of those objects show up. And what do we see? Yes! The new attributes that you just created! Yep! That's why we made them. Select the middle attribute of the controller and for the driven bones you'll want to select the rotateX, Y and Z attributes for all three bones.

Awesome. Now before we go ahead and start setting keys and mucking around I want to let you know that you can click around anywhere in Maya, but as long as you keep the Set Driven Keys window open, nothing will change in that section. Go ahead. Click something outside the SDK window. See? Nothing bad happened.
Ok. Now select the controller and click the middle attribute so it's selected (not necessary, but again.. I am old and quickly forget what I am working on so having it selected quickly reminds my aging braing what I was working on). With this done, are you ready to set your first set driven key? Go ahead. Click "Key" in the SDK window. Just click it once. Done?
Nothing happened? Oh... stuff happened alright, but it just doesn't show up at this moment. Now click your knuckle bone that we just keyed. And there it is! Keyed attributes! So what, I hear you say? Well, what you just did was tell Maya that whenever the "middle" attribute of the controller is set to zero, the rotation attributes of these three bones should be exactly what you have in your channel box.
Let's continue:
Select the controller again and set the middle attribute to 10 (our maximum). Now grab those bones and rotate away. I want my bones to curl into the palm of his hand so I do just that. Screenshot:

When you are satisfied with the end position hit that Key button again!
Congratulations!! You have just created your first setDriven key! Select your controller, Click the middle attribute and middle click and slide (inside the view window) to see what you have created.
Continue doing this with the rest of the fingers / toes / nostrils / exhaust vents on your flame throwing turret and you'll be set (driven)!
So you ask yourself: Why go to so much trouble when I can just animate the fingers / toes when it comes time to do it? Here's my answer: Time and Frustration. Less of it that, is. You will save you so much time and frustration by having one controller that controls both wrist position, finger position AND your entire arm of your character that when it comes time to breath life into this mesh, you'll thank yourself for taking the time to get your character set up right.
I hope you liked this little tutorial and I trust that you can see the power of Set Driven Keys and how they can be used to ease your animation burden quite a bit. What we did in this tutorial is pretty basic stuff and a LOT more complex things can be achieved with it.
btw.. the align script I mentioned can be found here:
Here!
PS! Don't be like me! Name your objects! :)
PPS! If you want more detail (such as in a real human hand) you might want to set your min value to a negative number and set that driven key so the fingers stretch up towards the back of the hand for a more realistic range of motion. You can also add another attribute called "stretch" which is where you stretch the fingers out as far as possible (for grabbing basketballs).
Thanks!
Fredrik S
Edit2: Found a more reliable server.
I know I am in the minority in this community since I use Maya, but the few of us that are still using it might find some interest in this article / tutorial.
Set driven keys. What can't they do? They're like little magic fairy helpers that run in the background and do awesome magic fairy stuff, that's what they do!
So what is a set driven key? Basically it's a little expression that tells object A to do B when object Y does Z. Ok. cool. But what can be done with it? Well, since I am mostly a character animator I use it for tons of little fiddly things such as hands, toes and such to all be controlled by one single controller. Nice, yeah?
I'll go through how I setup one hand of a character of mine and then you should have the basic concept down of how to use it for other things. Best of all... it works perfectly with Torque (since the exporter only looks positions of objects and not HOW things got to where they were).
Let's get started!
Here's a screenshot of a character.

Cool? We are only interested in the hands at this time, so let's take a closer look.

The hand controller (a simple nurbs curve which is culled out in the "NeverExport:" part of the dtsScene.cfg file at the time of export) is parented to the wrist node so that when we move things it follows along nicely. I use an align script to make sure that the controller is situated perfectly along the bones.
I hide the mesh since it's not important to this tutorial.
Let's get busy!

Select your hand controller and in your Channels box drop down box, (see screenshot) select Add Attribute. A new window will open up. so what's this, you ask? This is a place where you can add your own custom attributes that works exactly like Translate, Rotate, Scale that you already have in your channel box. The thing is that just adding these new attributes / channels won't do squat for you. You have to tell Maya what these new attributes actually do.
But I digress. Let's push on!

This screenshot shows you the important bits. First off, you need a name for your new attribute. Since I am old and easily forget things I like to name them things that make sense. So this new attribute will be the thumb wigglifier.
Next up is what type of attribute it is. Leave it at float (for you non programmy people there, let your eyes gloss over and continue down to the next paragraph) so we can have the attribute have values like 2.3569. Mmmm... such tasty decimals.
Next up you need a min value (starting position) and max value (ending position). I like using 0 - 10, but you can set whatever number you want in here. Finally, the default value should be the same as your min value. click Add and you have a new keyable attribute! Horraay!!

Now repeat this process with the rest of the fingers. As you can see, my character only has three fingers so I need two more attributes; index and middle. I use the exact same values as the thumb attribute.

Now we can get to what I said this tutorial was about. Set driven keys, baby!
What we want to do is to have a controller that not only controls the IK of the arm, but also controls the finger wiggling. You know.. so our character can pick his nose or whatever.
In the Animation section of Maya (F2), you'll want to click here:

This will open up a empty looking window and if you, like me, had the hand controller selected it will be defaulted to be the driven. We don't want that, so with the controller selected click "Load Driver". What this does is tell Maya that this object, in fact, is what will control the other objects. Your window will look something like this now:

Now we want to tell it what this controller will be driving! So select each of your finger bones and work your way up to the knuckle. I have three bones in each finger. I'll start with the middle finger and with those selected click "Set Driven" in your set driven window.

Ok! Cool. We now have a driver and something it drives (driven objects). Now select both the controller and the three (for you it may be more) bones and you'll see that in the right hand side of the Set Driven Key window the attributes of those objects show up. And what do we see? Yes! The new attributes that you just created! Yep! That's why we made them. Select the middle attribute of the controller and for the driven bones you'll want to select the rotateX, Y and Z attributes for all three bones.

Awesome. Now before we go ahead and start setting keys and mucking around I want to let you know that you can click around anywhere in Maya, but as long as you keep the Set Driven Keys window open, nothing will change in that section. Go ahead. Click something outside the SDK window. See? Nothing bad happened.
Ok. Now select the controller and click the middle attribute so it's selected (not necessary, but again.. I am old and quickly forget what I am working on so having it selected quickly reminds my aging braing what I was working on). With this done, are you ready to set your first set driven key? Go ahead. Click "Key" in the SDK window. Just click it once. Done?
Nothing happened? Oh... stuff happened alright, but it just doesn't show up at this moment. Now click your knuckle bone that we just keyed. And there it is! Keyed attributes! So what, I hear you say? Well, what you just did was tell Maya that whenever the "middle" attribute of the controller is set to zero, the rotation attributes of these three bones should be exactly what you have in your channel box.
Let's continue:
Select the controller again and set the middle attribute to 10 (our maximum). Now grab those bones and rotate away. I want my bones to curl into the palm of his hand so I do just that. Screenshot:

When you are satisfied with the end position hit that Key button again!
Congratulations!! You have just created your first setDriven key! Select your controller, Click the middle attribute and middle click and slide (inside the view window) to see what you have created.
Continue doing this with the rest of the fingers / toes / nostrils / exhaust vents on your flame throwing turret and you'll be set (driven)!
So you ask yourself: Why go to so much trouble when I can just animate the fingers / toes when it comes time to do it? Here's my answer: Time and Frustration. Less of it that, is. You will save you so much time and frustration by having one controller that controls both wrist position, finger position AND your entire arm of your character that when it comes time to breath life into this mesh, you'll thank yourself for taking the time to get your character set up right.
I hope you liked this little tutorial and I trust that you can see the power of Set Driven Keys and how they can be used to ease your animation burden quite a bit. What we did in this tutorial is pretty basic stuff and a LOT more complex things can be achieved with it.
btw.. the align script I mentioned can be found here:
Here!
PS! Don't be like me! Name your objects! :)
PPS! If you want more detail (such as in a real human hand) you might want to set your min value to a negative number and set that driven key so the fingers stretch up towards the back of the hand for a more realistic range of motion. You can also add another attribute called "stretch" which is where you stretch the fingers out as far as possible (for grabbing basketballs).
Thanks!
Fredrik S
Recent Blog Posts
| List: | 04/24/08 - Still Alive 02/19/08 - Back again with Survival 10/17/07 - Z 08/03/07 - Switching Gears Demo Available 07/24/07 - Maya tutorial set driven keys 06/25/07 - Switching Gears 04/17/07 - Switching Gears 02/08/07 - Switching Gears - New bad guy |
|---|
Submit your own resources!| Christian Herzog (Jul 24, 2007 at 20:03 GMT) |
We learn maya at our University and I can only say: a clean and properly setup rig (with driven keys & friends) saves sooo much time when animating - and it then makes a lot more fun, as you said!
| Brian \\\"Cybore\\\" Smith (Jul 24, 2007 at 20:52 GMT) |
| CDK (Jul 25, 2007 at 06:00 GMT) |
I think every bit of help you can provide them is valuable.
| Richard Van Stone (Jul 25, 2007 at 17:23 GMT) |
| Affectworks (Jul 25, 2007 at 21:37 GMT) |
There are more ways to setup feet than there are feet in the world. I like to keep things fairly simple (unless it's something that requires something anatomically correct) with a IK system with sticky enabled. I parent the IK to a nurbs circle under the foot, so the IK stays put unless the nurbs curve is moved.
Then I add controllers to keep the knees under control. Oh, I also limit the range of the nurbs circle so it can never go under 0 in Z. That way it'll always be above ground. I also setup set driven keys for toes using the nurbscircle as the controller, using the same method I have described above. I also use the nurbs controller and setdriven keys to setup the heel rotation if necessary.
There are many more sophisticated foot setups, but I have found this to work for me forgame characters that wear boots and such.
Here's one that uses multiple IK's paranted to eachother.
You must be a member and be logged in to either append comments or rate this resource.


Not Rated


