Open a comp in After Effects that has expression snippets.
Use the different options in the expression editor to customize your expressions.
You can customize the code editor interface of the expression editor, including highlighting JavaScript syntax with custom colors, line numbers, code folding, and auto-complete. To customize these options, select Preferences > Scripting and Expressions.
Customize syntax highlighting of JavaScript syntax and After Effects methods and properties:
Edit preferences:
Code Preview box:
All changes to the syntax colors and other editor preferences can be previewed live in this code preview box.
Tip: Use throw to debug expressions inline. You can use this when you want to see the code error within the expression editor field, to save time and efficient debugging.
Open a comp in After Effects that has expression snippets.
In the Timeline panel, select a layer and do Alt+Click. It displays the expression in the expression editor field.
Click the editor field to enter the edit mode.
In this example, select MILE in the first line, and change it to mile in lowercase. This triggers an error in the code, and After Effects displays an error message within the code snippet.
After Effects also displays an error banner with details about the Line number where the error occurs.
In the same expression, change the layer name from mile to MILE.
As you type, After Effects displays a drop-down list with a set of suggestions that After Effects pulls from the layer names of the project.
Composition names, layer names, footage names, and effect names are all pulled into the autoComplete and shown in the correct context with their respective comp(), layer(), footage(), and effect() methods. This allows you to keep your expression active while referencing items in the project. You do not need to scroll the Timeline or open other panels to refer to properties or items using the pick whip.
Now that you have understood some of the concepts behind expressions, come to the community for some real-life examples, and to share your work.
You can also check out Dan Ebberts' excellent collection of example expressions and tutorials on his MotionScript website.
The AE Enhancers forum also provides many examples and much information about expressions, as well as scripts and animation presets.
Sign in to your account