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

Creating an expression

From: After Effects Apprentice 09: Expressions

Video: Creating an expression

If you haven't already, revert back to a clean version of your AEA_expressions.aep project and open up the comp 01-Pick Whip*starter. Again, we have the blue pulley already animating. I'm pressing U to reveal its keyframes, and I'll press 0 on the numeric keypad to RAM Preview. We want the red pulley to perform this exact animation, at least for now. And rather than copying and pasting keyframes, let me show you another way. I am going to click on the red pulley, press S to reveal the Scale and Shift+R to reveal its rotation.

Creating an expression

If you haven't already, revert back to a clean version of your AEA_expressions.aep project and open up the comp 01-Pick Whip*starter. Again, we have the blue pulley already animating. I'm pressing U to reveal its keyframes, and I'll press 0 on the numeric keypad to RAM Preview. We want the red pulley to perform this exact animation, at least for now. And rather than copying and pasting keyframes, let me show you another way. I am going to click on the red pulley, press S to reveal the Scale and Shift+R to reveal its rotation.

Instead of just clicking on the animation stopwatch for Scale to enable it, instead I am going to hold Option on Mac, or Alt on Windows, then click on its scale. Rather than enabling keyframing, this enables expressions. I am going to drag this column a little bit wider, so see what's going on, and you can see this new line that says expression for Scale. After Effects has already written a little bit of code for us. It says, use the Transform property of Scale to be the scale of this layer, in other words equal yourself, a good starting point.

But instead of equaling ourselves, we want to equal what that other layer is doing. Well, to do that, we'll click on this little Pick Whip icon, drag it to the Scale property of the other layer--and you will see that After Effects highlights different property names and values to show you what you are targeting--release, and now After Effects has written an expression for you. Now I want to emphasize this, for most of this lesson you will not be writing code. After Effects will be writing code for you, and you just need to be making little modifications.

But if you are curious about what this is doing, let's read this. It's saying in this comp is a layer called Blue Pulley and we want to use its Transform property Scale. Straightforward enough. To accept an expression, you can either press the Enter key on the numeric keypad--not the normal keyboard, that will just start a new line--with the numeric keypad, or just click anywhere else in a blank area inside your Timeline panel, and now you have an expression. You see this little equal sign here that indicates that an expression is in force right now, and the parameter color will change to red instead of the default gold.

Now when I press 0 to RAM Preview, you will see that the red pulley is doing exactly the same scale animation as the blue pulley. It's not doing the same rotation. This isn't like parenting where you take out a lot of properties; we've targeted this one property, Scale, and expressed the red pulley to do whatever the blue pulley is doing. And just to show you that it is indeed doing whatever the other pulley is doing, let's go ahead and pick up this keyframe and move it a little bit earlier in time.

As I do so, you will see the red pulley is scaling in sync. I will RAM preview and it continues to copy exactly the same animation move that the blue pulley is doing. That's one of the big benefits of expressions. They are live. Edit the Master layer and the Express layers will automatically take up those changes; no need to copy and paste. Okay, we've got the Scale happening but not the Rotation, so let's go ahead now to add that as well. Again, I will hold down Option on Mac, or Alt on Windows, click on the stop- watch, go to my handy-dandy Pick Whip tool and drag that to the Rotation property for the blue pulley, the master I want to follow.

And this is important tip about expressions, by the way: before you start creating an expression, you need to reveal the properties that you want to connect to. I have already revealed the Rotation for blue pulley so I am in a good shape. Select that. There is my expression. Click off. It's been accepted. The parameter color changes red instead of gold, my equal sign is active, RAM Preview, and these two layers are now doing exactly the same thing. And I want to point out how easy it is to make changes to the master and have the slave follow.

I'll go to the end here. I'll change the Rotation for the blue pulley to -1, RAM Preview. Now they are both rotating exactly the same. I'll move that second keyframe for the blue pulley to equal its last Scale keyframe, RAM Preview, and again, both layers are doing exactly the same thing. And hopefully now you are starting to see some of the usefulness of expressions.

Show transcript

This video is part of

Image for After Effects Apprentice 09: Expressions
After Effects Apprentice 09: Expressions

20 video lessons · 10809 viewers

Chris Meyer and Trish Meyer
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 After Effects Apprentice 09: Expressions.

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.