I put off learning After Effects expressions for years. Even when my visual effects and motion graphics skills became pretty advanced, I had memorized only a handful of tricks and was hesitant to venture out. If you’ve just gotten comfortable in After Effects, adding expressions can be an intimidating step – if you aren’t yet comfortable in After Effects, it’s double scary 🙂

After Effects is animation and visual effects software sold as part of the Adobe Creative Cloud suite. You can find some less advanced material on my resources page, and an introduction to using VFX in small budget films in this lecture.

To many filmmakers, looking at lines of code may not feel “creative,” but film production attracts people with artistic and technical minds, so I think with me guiding the way you can imagine how these tools can help make our work better and faster. My Adobe Premiere tips were quite a hit, so today I have four super easy expressions to get you started using your first After Effects expressions TODAY!

At the very least, you should know what expressions are capable of doing, so you can call on an expert when streamlining a process might save you hours of work.

What Happened When I Embraced AE Expressions?

Let me tell you a story. A couple years ago, a local university athletics client called me up to do post-production on their moving headshots.

You know, these things

For their Mens’ and Womens’ Basketball teams, we were looking at something like thirty players. “The arena has two screens with different dimensions,” they explained. There’s the main screen, which is like a giant TV, and the ProTable, which is a long, wide strip in front of the press / announcers table. So now we’re looking at sixty headshots to deliver. “Every headshot needs the player’s name, number, hometown, major, and academic year,” they said.  We agreed I would make a template for each screen, get them approved, then proceed to fill-in-the-blanks for every player. I put the player info in a spreadsheet, and got to work.

I did the design work over an afternoon, got approval, then punched in some very important expressions. A clever designer could copy+paste from the spreadsheet to After Effects one entry at a time, saving a few seconds and avoiding typos along the way. With one little expression, she could link the ProTable Comps to the Main Screen Comps and automate half of the deliverables. With some advanced expressions, I made the whole thing fill itself out. Yes, I DID NOT TYPE ANYTHING.

Data entry is for robots.

Using After Effects without expressions is like spinning a power drill by hand. It will get the job done, but you’re missing powerful possibilities. Let machines do what they’re good at, so you can focus on designing, creating, and being a fun human.

What are Expressions?

Basically, expressions are instructions that tell After Effects what to do. Most often, this means linking properties together, controlling how and when properties change, and generating randomness (randomness is SO MUCH EASIER with expressions.) Properties are things like Opacity, Rotation, or the “Source Text” of a layer, as described in my story above.

Like a programming language, there are specific phrases you must use to make things happen, and you can define custom variables. Unlike a programming language, these little instructions are only applied in context, within your AE project. You can only apply expressions to a property, on a layer, in a comp, in an AE project.

No matter how complex, every expression simply results in a change to the property it was typed into.

Tips for Getting Started

    1. To add an expression, you hold the “Alt” key and click the property’s stopwatch. This reveals a box where you type expressions on the timeline, where the keyframes would normally be.Typing Expressions in After Effects
    2. Some expressions save you time immediately, while others are a challenge to set up. I’ll describe a few easy ones below to start with today.
    3. If you can keyframe it, you can control it with an expression (rotation, opacity, and position, for example).
    4. A bit less obvious: If AE considers someting a property, your expression can request that information. The name of your comp, the current timecode, the in and out points of your composition, can be called upon even though you can’t change them with an expression.
    5. Because expressions are applied within a composition, there is sometimes a time dimension present automatically, meaning things change over time. Sometimes this is helpful, sometimes it’s an obstacle. To me, the dimension of time is the biggest difference between After Effects expressions and other programming techniques.

Four Expressions  Use Today:

Time – The “time” expression uses the comps timecode to give you a number that increases in a linear fashion while the comp plays. At frame 0, it’s 0, at frame 180, it’s 180. So if you put “time” into the rotation property of a layer, it will rotate at a constant speed, reaching a full 360 degrees in 360 frames. Want it to go faster? Try “time*100” to make it 100 times faster. Easy, right!?Using the Time Expression in After Effects

Wiggle(x,x) – I suspect most designers start with the wiggle expression. This makes a property change randomly, and you can choose how extreme or subtle it is by putting two little numbers in the parenthesis. Expressions with parenthesis use these extra bits of input, called “arguments,” to give you some control. For wiggle, the numbers mean frequency (how often it should change) and amplitude (how much it should change). Put “wiggle(2,40)” into the Position property of a layer, and it will move up to 40 pixels in any direction every 2 seconds. Raise the frequency to 10 and it will move every frame, vibrating rapidly. Lower the frequency to 1 and it will drift around slowly. AE will either add or subtract the amplitude, which is why this example wiggles down (+100) or up (-100). Since “Position” has a left-to-right dimension as well, hence the movement in all directions. Create a flickering effect by putting this expression on the opacity of a layer, or on an effect like “Exposure.”

Using the Wiggle Expression in After Effects

Source Text – For your first text expression, find the property “Source Text” on a text layer and put “thisComp.name” on it. Now this text layer will display the title of the composition it is in. Not super useful yet, but if you go into the project bin and duplicate this comp several times, update the title of each comp and you’ve effectively “edited” the text without ever opening the other comps. Believe me when I say this is the tip of the iceberg for motion graphics 🙂
Using Source Text Expression in After Effects

Random() – For totally random values on a property, look no further than “random().” By default, it comes up with a random number between 1 and 0, so you’ll want to use some math to modify it for certain properties. For example, opacity needs a value between 0 and 100, so “random()*100” would make the opacity oscillate within a suitable range, and probably warrant a seizure disclaimer. One of my favorite uses is to put this in the Source Text property to generate random numbers for that Sci-Fi HUD look.Using the Random Expression in After Effects

Action Step: Open After Effects and try one of the expressions above TODAY. If you’re feeling adventurous, try combining a few of these for new results.

The power behind these expressions is massive, but that’s only one of the reasons I’ve been an Adobe user since 2004, and a Creative Cloud customer since 2015. I’ve built my career around this robust, reliable, and professional software. If you’re new to After Effects or other software in the Adobe suite and thinking of signing up soon, check out current pricing here and I’ll get a little commission if you decide to sign up. If you’re a student or university employee, look for Adobe’s “educator pricing.”

Take it to the Next Level

Was this too easy? Here are a few items to research and experiment with next, to up your game.

Use sliders – Tweaking your code constantly isn’t fun or efficient. Luckily, After Effects offers sliders, angle controls, and more, under “Effects and Presets.” Linking a property to a slider, or incorporating a slider into your expressions, gives you a visual control for modifying properties while your code works behind-the-scenes.Using the Slider Control in After Effects

 

Make a Master Control layer – Expressions are powerful on one layer, but linking multiple layers to a single control is even better. Make a null layer, throw some sliders on it, and link layer properties to these sliders. This begins to make your code feel more like using a plugin, and it’s wonderful for making templates for future use or to share with colleagues.

 

Use the “pickwhip” – If you’ve used the pickwhip to “parent” a layer to another, you will notice a similar icon appears for properties when you add expressions to the. Click-and-drag the property’s pickwhip to another property to incorporate the target property into your expression. A great example is the animation of a clock: pickwhip the minute hand’s rotation to the hour hand’s rotation property, then type “*60” to make it sixty times faster. Now no matter what you do to the hour hand (with keyframes or perhaps a “time” expression), the minute hand will always be moving faster by the correct amount.After Effects Pickwhip

More challenging expressions might save you time in the long run. Ask yourself: what processes do you find yourself doing over and over again in your workflow? Think about ways to link properties together, and ways to replace keyframed animations with expression-driven animations so you can adjust the speed of the animation rather than hunting down the keyframes and sliding them around.

I hope this gave you the courage to start using expressions in your After Effects workflow. If you want to see more posts like this, or more advanced tutorials, send me a message or leave a comment with your thoughts.

Make it your New Year’s Resolution to start using expressions in 2019, and have a happy, creative, productive year!

Leave a Reply