Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member

Linking properties

From: 2D Character Animation with After Effects

Video: Linking properties

So now we get to the really exciting bit where we learn about expressions and scripting that can make animation, particularly character animation, a lot easier. So you don't have to figure out things like angles and have to animate every single body part individually. After Effects provide you with two features, expressions and scripting that will help with these. Now, If you want to follow along we're in the expression and scripting project Which is in the expression and scripting folder.

Linking properties

So now we get to the really exciting bit where we learn about expressions and scripting that can make animation, particularly character animation, a lot easier. So you don't have to figure out things like angles and have to animate every single body part individually. After Effects provide you with two features, expressions and scripting that will help with these. Now, If you want to follow along we're in the expression and scripting project Which is in the expression and scripting folder.

Okay, so here I have a little character and I've done some animation in here, in time with audio. What I've done is I've created markers in time with the beats of the audio, just by hitting the asterrix key as I preview the audio every time a beat happens. And then if I zoom in, you can see I created a marker for each beat of the audio and I can jump between those markers by hitting the j and k keys on the keyboard. And now set up some animation to go in time with the markers and if we just preview that you can see a little bit of that animation.

Okay so lets preview a small section. (music playing) Okay. And what I've done is I've rotated the body in time with the music and because I've set up a parenting structure where nearly everything is attached to the body, when the body rotates everything else follows. Now I'm going to show you how we can take that initial rotation keyframing. And use it to control all the other layers. So we only have one set of keyframes to worry about.

Now to do this I'm going to use expressions and those of you who are a bit nervous of programming and scripting may be thinking oh no I'm never going to be able to learn that. Well don't worry because I was exactly the same. I'm a creative person I'm not mathematically gifted in any way. And when I first saw expressions and After Effects I couldn't envisage myself ever learning how to use them now, and if I can do it anyone can do it. So don't worry about it being to complicated. In fact here's how easy it is. If I want to get the left arm say, animating in time with the body. Then what I do is I select the left arm and then choose the property that I want to animate, in this case, rotation.

And there we go. That's what we want to get animating in time with music. I select the property by clicking on the name. And then I go to animation, add expression, okay. And there's a small expression in the expression field at the moment. I don't relaly want you to worry about that because After Effects will write the expression for me. So at the moment don't worry about that. Just go straight to this area here where you'll see some buttons. And this button here is a pick whip button.

You may remember seeing the pick whip in parenting, when you looked at parenting. The pick whip button for expressions can be used to link properties together and this is how easy it is for me to take the rotation from here to here. All I need to do is click and drag that pick whip and pick up the rotation from there. After Effects writes the expression for me. And to activate I can either click on this grey area here or hit the Enter key on the number pad not to the return key on the keyboard because the return key will add another carriage return in there.

And once I've applied that and preview it, you'll see there's a small amount of rotation happening to the arm. {MUSIC} Okay, I want a little bit more animation, so the time comes for me to go in and edit the expression. But it's very easy to do that so, even with no experience I can very easily multiply the amount of Rotation say by 3 times just to give me more rotation and this is how it's done. First of all, I'm going to explain what the expression is saying, so that you can understand what I'm doing.

The expression is saying, take the rotation of this value from this comp, which means this composition layer body which is the body layer. Tranform property group, and if close and open that you'll see transfrom porperty group rotation value. So it's like giving it an address to take it from. And that represtent the value that we have now. So the values match. Basically when this one is 2.1, that one is 2.1. If that one's 6.8, that one's 6.8. So they just follow each other. But if I go to the end of the expression and make it editable, I can type in asterisk 3, and that's going to take the value that's provided from that and multiply it by 3. And if we click away from the expression and preview it again, you'll see I've got three times as much rotation.

(music playing) Now I can continue adding, subtracting, multiplying and dividing, there are other ways of creating values, but we're going to stick with this just now. So, if I want to maybe. Bring it up a little bit I could add, you know, a value and degrees to that, so I could put plus 20 and that will move it round by 20 degrees. So basically we've got the same rotation value as this multiplied by three and then 20 added to it.

Okay, and I can continue doing that. I could go to my left fore arm now, open up pitch rotation value and the keyboard shortcut for writing an expression is hold down the alt key and click on the stop watch. And then I just drag the pick whip to this one, the left arm rotation, and if we activate that, we'll see that that arm's moving as well, okay? So the forearm and the upper arm are moving together.

(music playing) Now, what if I want to get the right arm moving as well? Let's open up the right arm. So we'll leave the left arm's rotation value open. We'll open up the right arm, if I can find it down here. And again, Alt-click on the stopwatch, hold down Alt, click on the spotlight, drag the pic wick up to the left arm and preview it. So, now I've got both arms moving in time with the audio. But what if I want this one to move in the opposite direction? Well, there's aMUSIC little trick there as well, which I'm going to share with you. If I click to the end of the expression and multiplying by minus one, I will get the opposite result and now you'll see that the arm is moving in the opposite direction to the other one, which gives me a much nicer effect. Now while I'm in there, I'm also going to go to the hips, and put an opposite rotation as to the one that's happening to the body. And that will make the legs stay still, because the legs are pinned to the hips. So lets alt-click on the stopwatch for rotation.

Drag the pickwhip down to the body rotation value, and then multiply it by minus one, hit enter, and now we have still legs, while the rest of the body animates. (music playing) Now before we look at the whole thing I've also added some expressions to the other layers which you can turn on. If I select all the layers and double hit e on the keyboard you'll see I've already added some other expressions.

Now, to switch them on, you click on the enable expression button for each of the layers. So we'll scroll down, switch those on, and then preview our final animation. Now, the nice thing about this is, if we preview a little bit. (music playing). If we want to speed up or slow down the animation. Let's just zoom in a bit there. All I need to do is go back to the original keyframes, so that select all, hit r on the keyboard for rotation and just adjust the timing of those key frames, and then all of the other layers will update. So really fantastic, quick way of animating by linking properties together using expressions.

Show transcript

This video is part of

Image for 2D Character Animation with After Effects
2D Character Animation with After Effects

27 video lessons · 2778 viewers

Angie Taylor
Author

 

Start learning today

Get unlimited access to all courses for just $25/month.

Become a member
Sometimes @lynda teaches me how to use a program and sometimes Lynda.com changes my life forever. @JosefShutter
@lynda lynda.com is an absolute life saver when it comes to learning todays software. Definitely recommend it! #higherlearning @Michael_Caraway
@lynda The best thing online! Your database of courses is great! To the mark and very helpful. Thanks! @ru22more
Got to create something yesterday I never thought I could do. #thanks @lynda @Ngventurella
I really do love @lynda as a learning platform. Never stop learning and developing, it’s probably our greatest gift as a species! @soundslikedavid
@lynda just subscribed to lynda.com all I can say its brilliant join now trust me @ButchSamurai
@lynda is an awesome resource. The membership is priceless if you take advantage of it. @diabetic_techie
One of the best decision I made this year. Buy a 1yr subscription to @lynda @cybercaptive
guys lynda.com (@lynda) is the best. So far I’ve learned Java, principles of OO programming, and now learning about MS project @lucasmitchell
Signed back up to @lynda dot com. I’ve missed it!! Proper geeking out right now! #timetolearn #geek @JayGodbold
Share a link to this course

What are exercise files?

Exercise files are the same files the author uses in the course. Save time by downloading the author's files instead of setting up your own files, and learn by following along with the instructor.

Can I take this course without the exercise files?

Yes! If you decide you would like the exercise files later, you can upgrade to a premium account any time.

Become a member Download sample files See plans and pricing

Please wait... please wait ...
Upgrade to get access to exercise files.

Exercise files video

How to use exercise files.

Learn by watching, listening, and doing, Exercise files are the same files the author uses in the course, so you can download them and follow along Premium memberships include access to all exercise files in the library.


Exercise files

Exercise files video

How to use exercise files.

For additional information on downloading and using exercise files, watch our instructional video or read the instructions in the FAQ.

This course includes free exercise files, so you can practice while you watch the course. To access all the exercise files in our library, become a Premium Member.

Join now "Already a member? Log in

Are you sure you want to mark all the videos in this course as unwatched?

This will not affect your course history, your reports, or your certificates of completion for this course.


Mark all as unwatched Cancel

Congratulations

You have completed 2D Character Animation with After Effects.

Return to your organization's learning portal to continue training, or close this page.


OK
Become a member to add this course to a playlist

Join today and get unlimited access to the entire library of video courses—and create as many playlists as you like.

Get started

Already a member?

Become a member to like this course.

Join today and get unlimited access to the entire library of video courses.

Get started

Already a member?

Exercise files

Learn by watching, listening, and doing! Exercise files are the same files the author uses in the course, so you can download them and follow along. Exercise files are available with all Premium memberships. Learn more

Get started

Already a Premium member?

Exercise files video

How to use exercise files.

Ask a question

Thanks for contacting us.
You’ll hear from our Customer Service team within 24 hours.

Please enter the text shown below:

The classic layout automatically defaults to the latest Flash Player.

To choose a different player, hold the cursor over your name at the top right of any lynda.com page and choose Site preferencesfrom the dropdown menu.

Continue to classic layout Stay on new layout
Exercise files

Access exercise files from a button right under the course name.

Mark videos as unwatched

Remove icons showing you already watched videos if you want to start over.

Control your viewing experience

Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.

Interactive transcripts

Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.

Are you sure you want to delete this note?

No

Your file was successfully uploaded.

Thanks for signing up.

We’ll send you a confirmation email shortly.


Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

Keep up with news, tips, and latest courses with emails from lynda.com.

Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

   
submit Lightbox submit clicked
Terms and conditions of use

We've updated our terms and conditions (now called terms of service).Go
Review and accept our updated terms of service.