Learning a Second Language - Why Motion Designers Need to Understand Scripting and Expressions
What is an expression?Expressions are used to create relationships between layer or node properties. By using expressions you can make either one layer property mirror or offset another layer property. In After Effects, this is as easy as using the pick whip to link one layer property to another. You can also use expressions to tell a layer property what to do or how to react without using other layers. For instance, you can apply wiggle (10,10) to the position property of a layer. This expression will set that layers position based on time and it's original position.
What is a script?A script contains a series of commands that tells an application to do something. When a script is run, After Effects performs the defined operations and then it is finished. Scripts can be used to automate repetitive tasks such as renaming layers to more complex tasks like creating a series of compositions and structuring them in folders. Scripts can also do things that you typically wouldn't see in the UI. For instance, you can have After Effects send you an e-mail when a render is complete. This is helpful if you have other things away from the computer you need to work on and are able to receive email notifications on your phone. Now that you have a little understanding of how an expression or script can be used, you might be wondering how they can help you be a better artist or designer? Expressions and scripts can save time and lots of if when used throughout your workflow.
The expression is then built and attached to that layer's attribute. Once you become comfortable with using the pick whip to build expressions, you can explore what else After Effects has to offer by clicking the carrot next to the pick whip icon. There, you can access many functions that can be used to build your own custom expressions and then create custom controls and sliders to allow you to key frame your expressions. Once you get that far you should be comfortable enough to begin writing your own custom expressions from scratch.