X

‘Get Fueled’ Subscribe, Participate & Contribute

 

Express Yourself (With After Effects Expressions)

So you’ve mastered keyframing, become an Easy Ease assassin, even tackled adjusting velocity and other curves with the Graph Editor, but you still need to find a way to tweak your After Effects projects even further? Man, who are you, Harry Frank? Well, lucky enough for you, there is another option that offers a lot of flexibility that you might not have even known existed or have shied away from because you were overwhelmed just by the sheer thought of attempting them. Yes, I’m talking about expressions.

What Are Expressions?

thislookslikecode

When you first see an expression you might think it looks a lot like code. There’s a good reason for that–it is code. It’s a scripting language based off of Javascript, but you don’t need to know that in order to use it (although, that would help). Basically, expressions are highly flexible formulas (similar to, and sometimes are, mathematical formulas you learned in high school) that allow you to do anything keyframes or the Graph Editor would allow you to do and more. Much more. Plus, once you get to know how to write them, it can be a lot quicker and less tedious (in most cases).

When To Use An Expression

Well, I just got done telling you expressions can save you a lot of time and frustration, but are they always the best option? No. Some people you run into will swear expressions are the only way to go. Realistically, when using expressions, you can create and entire project with only a few keyframes and handful of code when it would take multiple keyframes and bouts with the Graph Editor to do the same. I can’t tell you how you’re going to feel about expressions, but I feel the only time you should be using expressions are when there are no other options available to you. You wouldn’t create an expression when it’s easier to just parent an object, of course. After Effects is a toolbox full of special tools, each for a special purpose. It’s best to use the right tool for the job.

How Do I Create An Expression?

It’s simple, really. Hold down the Option key (Alt key on a PC) and click on the stopwatch next to a property name (Orientation, X Rotation, Y Rotation, etc.) in any layer in your comp. Once this happens, you will have four new buttons to play with and a input box will appear for you to type in.

expression

The four new buttons are:

equalThis simply allows you to turn on and off the expression.

 

graphSelecting this allows your expression to be graphed in the Graph Editor.
 
 
 
pickwhipMuch like the layer pickwhip that allows you to parent objects, this allows you to easily assign a reference to target.
 
 
menuOpens up a large menu for you to choose your expressions from.
 
 
 
There is a fifth button, but hopefully you won’t see it too often.

errorThis shows up right before the equals sign when there’s an error in your expression. Clicking on it will bring up a box telling you what the error is. Correcting your expression will get rid of the error altogether.

How To Read An Expression

express2An expression is set up to be read from left to right, although that’s not the case with mathematical equations (more on this in a little bit). You can think about it as drilling down from the biggest to the smallest. For example, in the expression above, we have Composition (thisComp.), Layer (layer(”ball”).), Property (transform.), Attribute (position[0]). So, it’s looking in the current composition for a layer titled “ball” for the position of the transform property.

express The same applies for the next example, except I attached it to the CC Sphere effect. We are looking in the current composition for a layer titled “ball” for the Y rotation in the CC Sphere effect.

MATHIn the expression set up above, After Effects would read it left to right, but that’s not always the case. If you remember back to your high school math classes, everything in parentheses & brackets are calculated first followed by multiplication & division then addition & subtraction. If you have any Javascript math in your equation, After Effects will calculate that second (right after what’s in parentheses & brackets). Knowing this, if the parentheses were at the end of this expression, they would get calculated first, then it would be the multiplication & division followed by the addition & subtraction. It’s not very often that you will use mathematical equations in expressions (at least, not in my experience), but be aware of this, none-the-less.

How Can Expressions Help Me?

Like I said before, expressions are another tool in your After Effects toolbox. Knowing when and how to use them will not only allow you to expand your knowledge and skillset, but your usefulness on a project, as well. Expressions are a very useful and robust system that will help you speed up your workflow and save you some frustration.

Where Can I Learn Them?

I’d love to go in depth on how to use expressions, but that would make for a whole series of articles that really can be as robust as After Effects itself. Besides, others have done a wonderful job at it, so why not learn it from them. Here’s a short list of training material and websites you can visit to learn expressions.

harry
, over at GrayMachine.com, has a great series of tutorials dealing with expressions. In fact, it’s three complete hours of expression knowledge right from a master in the After Effects field. It’s a must have for anyone wanting to learn expressions, and it’s only $39.99.

Screen shot 2010-10-14 at 12.10.00 PM

has a ton of help files, a complete reference of the expression language and many examples on their website. You would be crazy for not going here and absorbing this free knowledge.

Screen shot 2010-10-14 at 12.16.05 PM
You want more free expression knowledge? Well, Dan Ebberts has a ton of it on his website, MotionScript.com. There’s a lot of information on his site ranging from the basics to examples. Definitely check this out.

Screen shot 2010-10-14 at 12.21.24 PM
Another website with a wealth of free knowledge, JJ Gifford lays down the knowledge from basics to advanced giving you great visual examples along the way.

Screen shot 2010-10-14 at 12.25.31 PM
Of course, you can’t leave Creative Cow out of the list. They have a lot of free tutorials on how to use expressions as well as a great forum where you can ask questions and get them answered almost immediately. Never leave the cow out when you’re thinking about learning.

Now Go And Express Yourself

This is just the very tip of the iceberg when it comes to expressions in After Effects. Visit the sites I listed above, then go out and search for more (there are plenty of them out there). You may find you either love them or hate them, but by just adding expression knowledge to your toolbox will give you the edge when it comes to that next project.

 

If you liked this article, please help spread the news on the following sites:

  • Clip to Evernote
").html(content).css({ position: 'absolute', top: '-9999px', left: '-9999px' }).appendTo("body"); ev.find('style').appendTo("head"); Evernote.doClip({"title":"Express Yourself (With After Effects Expressions)","url":"http:\/\/fuelyourmotionography.com\/express-yourself-with-after-effects-expressions\/","code":"fuel9896","suggestNotebook":"FUEL Creative Notebook","suggestTags":"adobe,after effects,creative cow","styling":"full","providerName":"Fuel Your Motionography","contentId":"evernote-post-single"}); }