Start learning with our library of video tutorials taught by experts. Get started

After Effects Apprentice 09: Expressions
Illustration by John Hersey

Creating an expression


From:

After Effects Apprentice 09: Expressions

with Chris Meyer and Trish Meyer

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.

Watch this entire course now—plus get access to every course in the library. Each course includes high-quality videos taught by expert instructors.

Become a member
please wait ...
After Effects Apprentice 09: Expressions
1h 37m Intermediate Jul 27, 2011 Updated Nov 29, 2012

Viewers: in countries Watching now:

Expressions are one of the most powerful but underused features in After Effects. They can be used to animate layer properties with code, as compared to explicitly keyframing every value in the Timeline, and have multiple parameters and layers that follow the lead of a master layer or controller effect, making it much easier to coordinate complex animations and quickly accommodate client changes. In this introduction, Chris Meyer shows how to let After Effects do most of the work by creating simple but very useful expressions that can be put to work on a wide variety of jobs.

The After Effects Apprentice videos on lynda.com were created by Trish and Chris Meyer and are designed to be used on their own and as a companion to their book After Effects Apprentice. We are honored to host these tutorials in the lynda.com Online Training Library®.

Topics include:
  • Creating and managing expressions
  • Linking together different parameters
  • Randomizing a layer's movement
  • Looping an animation
  • Controlling multiple layers from a single source
Subjects:
Video Motion Graphics Visual Effects
Software:
After Effects
Authors:
Chris Meyer Trish Meyer

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.

Find answers to the most frequently asked questions about After Effects Apprentice 09: Expressions.


Expand all | Collapse all
please wait ...
Q: This course was updated on 11/29/2012. What changed?
A: We have added exercise files designed for After Effects CS6. We also added a movie that shows our premium subscribers how to use the exercise files.
 
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.
Upgrade now


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 Upgrade now

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

Notes cannot be added for locked videos.

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.