Join George Maestri for an in-depth discussion in this video The basics of expressions: Controlling the wrist, part of Creating Animated Characters in After Effects.
- View Offline
The cuff is basically cutting into the hand, both on this side and on that side. Now in the real world, that cuff would kind of flex; it would tend to move along with the wrist. Now we can do that easily just by animating the hand, and then grabbing the wrist and animating that. Basically, what you want to do is rotate the wrist here, then rotate the hand, and as you can see, it gets very, very, very complicated, and it's not an easy way to animate. So the better way to do this is to automate the cuff so it matches the rotation of the hand.
That way you don't have to animate two things, and it's automated. So the first thing we want to do is create what's called an expression. So I'm going to go ahead and select my Left Cuff and open that up, and you'll notice we have a Rotation field here. And what I want to do is insert what's called an expression. So I'm going to highlight Rotation, and then under Animation > Add Expression. What this does is it creates an Expression for Rotation.
And we have a couple of buttons here; one is to enable or disable the expression; obviously we want to enable it. We can also show a graph. This here is basically a Pick Whip, it's very similar to the Pick Whip you use with hierarchies, and we actually are going to be using this. And then over here, we actually have an expression. So the expression is basically text, and we'll get into syntax a little bit, but let's just do a very, very simple expression at first. What I want to do is tie the rotation of this, the Cuff, to the rotation of the Hand.
So let's go ahead and open up the Hand here, and you'll see that we have a Rotation field. I am going to go ahead and give myself a little more room here. So you'll see that the rotation here on the Cuff is controlled by an expression, and the rotation on the Hand is actually animated, or controlled by the animator. So what I'm going to do is select the Pick Whip on the Cuff, and you can see I can drag that to any value, but I want to drag it to the Hand Rotation value. And watch what happens when I do that; this value changes.
So let me read you what this says, and I'll give you a little bit of insight into what's going on here. First of all, it says thisComp, which is this composition, so we're using Gus_All, and then the layer called LEFT HAND, which is this layer, and then we want to look at transform.rotation, which means Rotation. So basically, I'm taking rotation from the Hand layer in this composition, and using that to create this rotation. So if I go into the rotation of this Hand, you'll see that now what happens is this follows along.
So if I rotate the Hand, say, 10 degrees, you'll notice here Rotation in the Cuff is also at 10 degrees. You notice how it's also in red, and that just tells you that it's being driven by something else. As you can see, I can rotate my wrist up or down without the cuff cutting into the hand, and this can be very, very handy. Now another thing we can do is we can take this value here, and we can change it. So right now, I have this working at a 1:1 ratio. If I rotate this 10 degrees, or 11 degrees, the cuff will also rotate at 11 degrees, but maybe I don't want it to rotate exactly with the hand; maybe I only want it to rotate half as fast.
So I can change that simply by taking this expression and adding a mathematical term to that. Now don't get scared; all I'm going to do is divide by 2. So I'm just going to hit the slash and 2. So basically the value that we have here is going to be this value over 2; in other words, half of whatever the hand is giving it. If I rotate the Hand to 10 degrees, let's just type in the number 10 here, you'll see that the rotation of the cuff is only 5 degrees.
So now it's rotating a little bit less, so that's actually just a gentle rotation. So I'm basically kind of reducing the effect of the hand rotation. If I want, I can divide by a larger number to get less of an effect, or I can go the opposite way, and multiply. So if I multiply by 2, it will rotate twice as fast as the hand is moving. These are some of the basics of just setting up an expression, and you can start to see how this can be very valuable. Once you really get into it, it can really help to automate, and make your characters much easier to animate.
- Importing Illustrator or Photoshop files into After Effects
- Animating shapes
- Organizing scenes with null layers
- Working with the Puppet tool
- Creating replacement animation using time remapping
- Automating head turns
- Creating a master control node with Expression Controls effects
- Setting up a scene for animation
- Animating dialogue