Expression Wizardry πŸ§™πŸΌβ€β™‚οΈ

Page building-in-progress

Introduction

Developing our intentions

Discovering why

Expressions are small pieces of JavaScript code that you can plug into animated properties in your After Effects projects, that evaluate to a single value for a single layer property at a specific point in time. They can help us

  1. Avoid manual repetitive tasks & save hours

  2. Develop advanced motion techniques

  3. Create complex generative art & design

  4. Tool development

    1. custom animation toolkit, setups and rigs

    2. Animation presets building

  5. Automation eg. lower-thirds versioning

FAQs

  1. How do I use an expression?

  2. Do I need to learn Javascript?

  3. How do I get good at it

​

​

Accessing attributes & methods

  1. Coding can be difficult when starting out, it is no different from learning a foreign language, and it takes considerable amount of time before you actually achieve fluency. Before we get into the coding segment, you need to develop a mental model of how coding work.

  2. video Consider this scenario: Imagine After Effects is an actual person, and you asking it to "animate a ball from left to right of the screen within 4 seconds in this composition".

  3. AE would be confused because it does not understand:

    • What composition are we using?

    • What is a ball? Which layer is it?

    • What is left and right? How many pixel is that in X or Y axis?

  4. This is what is going on:

    1. You : Comp( "???").thisLayer( "???").propertyGroup( "???").property[?]

    2. AE: Comp( "scene").thisLayer( "ball").transform.position[0]

  5. To break it down, notice each part is separated by a period (.) operator and it translate as in composition "scene" > layer "ball" > transform properties > position > X

  6. Think of it as β€œMachine Talk”. You are talking to a robot that needs really specific instructions.

  7. video you notice this when you pickwhip a properties into the expression box

  8. notice the period (.) operator.

Week 1 assignments

  • In the Exercise 1.1 After Effects file, write down the following code for all the layers. You are not allowed to use the pickwhip.

    • x position

    • rotation

    • slider control

Arrays & Variables

Expression focus:

Core skill: pickwhip expressions, troubleshooting, repetition

  • Animation preset creating color controls - shape layer

  • ternary operator

  • modulus operator - creating alternating color controls

Assignment

  1. Arithmetic & Mathematics: (not allowed to use pickwhip)

    1. Using the Circle shape layer, have the repeater automatically rotation itself and a radius control

    2. Do the same thing without the repeater, have the shape scale down smaller by 5% and rotation by 15% for each iteration.

  2. Arrays & Variables

  3. What is a variable and why? Variable containers for storing data values, be it numbers, arrays, or text strings.

  4. What cannot be an variable? Declaring variables or Arithmetic

  5. What is an array: An Array is a type of object that stores an ordered set of numbers. An Array is represented as a list of numbers separated by commas and surrounded by brackets

    • You can assign an Array object to a variable, making it easy to refer to array values in other areas of the expression. For example:

  6. What is an element? 0 and 1 on & off confusion (boolean)

    • You can access the individual elements of an Array object by using brackets and an index number to indicate which element you want. The elements in an Array object are indexed starting from 0. Using the previous example, myArray[0] is 10 and myArray[1] is 23.

  7. Keep in mind: Javascript is a case-sensitive language, so be sure type in the correct variable names: these variables: myVariable, myvariable,MYVARIABLE are all different variables.

  8. Quiz: Which of these transform property is an array?

  9. Quiz: Which is element number is .... , (answers are in the caption)

  10. challenge recreate this simple wiggle array exercise: 1. create a variable called x and assign the first element of the wiggle function to it, then create

x = wiggle(10,200)[0];[x,value[1]];

Hello friends, here is Part 3 to Expression Wizardry ! This week we learn about variables and arrays. These are the basic building blocks of coding, you have to know this if you want to write expressions with ease! I even included quizzes and a challenge to test your comprehension and understanding. Please let me know if you have any questions or if things are not clear enough for you!

Here is the answer for the expression challenge: x = wiggle(10,200)[0]; [x,position[1]];

  1. Conditional

  2. What is a conditional statement: Conditional statements are used to perform different actions based on different conditions. Use the if statement to specify a block of JavaScript code to be executed if a condition is true.

  3. example if(x>50) x<50

  4. common trap: =50 use ==

  5. Comparison Operators & Logical Operators:

    1. operators that compare values and return true or false

    2. operators that combine multiple boolean expressions or values and provide a single boolean output.

    3. boolean: is a data type with two possible values: true or false.

  6. the else statement: Use the else statement to specify a block of code to be executed if the condition is false.

  7. example

  8. ChallengeQuiz: Decipher this lines of code + answers in description

  9. For Loop

  10. What is a loop statement: Loops can execute a block of code a number of times, saving you the need to copy and paste or otherwise repeat lines of code. There are different types of loops such as the for loop, while loop, or do while loop.

  11. A commonly used loop is the for loop which allows you to repeat the body of a loop a specified number of time.

  12. Here is how it works, the counter variable (i) is set starting at 0, then the boolean expression is checked (whether the condition is true), if it is true, execute the loop and if false, stop the loop. The counter variable is incremented again, and the boolean expression is checked again, and the whole process repeats

    for(i=0; i<10;i++){
    //statement to execute
    }
  13. To simplify the explanation, a for loop starts at 0, a conditional expression is checked, if true, execute then increment denote. i++ simply means i+1 after each loop have been completed

    for(start;condition;increment){
    //statement to execute
    }
    ​
    Statement 1 is executed (one time) before the execution of the code block.
    ​
    Statement 2 defines the condition for executing the code block.
    ​
    Statement 3 is executed (every time) after the code block has been executed.
  14. Keep in mind these elements are separated by semicolons not commas!

  15. video Here is an example of how for-loop can repeat source text in a text layer for a specific number of times. The number of times to repeat is denoted by the variable "n" which equals to 20. That means the code will add the sourcetext to itself by 20 times, hence a text repeater

    s = mytext = value;
    n = 20;
    ​
    for(i=1;i<n;i++){
    s+= mytext;
    }
    s;
  16. You can connect the n variable to a slider, and control it via the effects panel or save it out as an animation preset

  17. cta give this expression a try, and watch my tutorial "text repeater preset setup" (link in bio)

Working with Strings

  1. Double quotes

  2. Parsing string into number

  3. Parsing number into string

  4. Getting dates and concatenating text

  5. using text as read out: sourceRect & pickwhip slider

  6. Aenhancers: masks

  7. expression: numLayers, thisComp.name, length

  8. challenge Get

  9. String operators: split, regex, replace, substitute

  10. Functions

  11. think of them as robots which can only perform one tasks or small computations

  12. Functions (robots with no agency) insert emoji

  • visuals

  • Random displacement

  • Animating in a circle and a spiral fashion

  • Making an image carousel

  • radial scale up staggering - Buck Apeel with valueAtTime

  • Commonly used expression

    • time & drift

    • slider controls

    • random

    • wiggle

    • posterizeTime

    • sourceRectAtTime

  • What do I do if forget what an expression do? Expression Aehancers,

  1. Wiggle

  2. general (see ukra)

  3. time

  4. Basics: Difference

  5. brief

  6. it is about to know the difference between the following

  7. we know that expression a code snippet

  8. Animation Preset

A script is a series of commands that tells an application to perform a series of operations.

Automate repetitive tasks, perform complex calculations, and even use some functionality not directly exposed through the graphical user interface

Think of it as a cooking recipe that give to After Effects

Difficulty: 1/10

  1. Script:

A script is a series of commands that tells an application to perform a series of operations.

Automate repetitive tasks, perform complex calculations, and even use some functionality not directly exposed through the graphical user interface

Think of it as a cooking recipe that give to After Effects

Difficulty: 5/10

  1. ScriptUI

  2. ​

Works just like a script but you get a user interface that allows you to specify additional settings.

Examples: Ease & Whizz, Ray Dynamic Color

Difficulty: 6 / 10

  1. Extension

  2. Plugins

  3. ​

"A plugin is a component that adds a specific function or feature to an already existing software. Plugins are almost universally developed by third-party developers, and not the developers of the original software itself (Adobe)." β€” School of Motion Blog

Written in C++

Difficulty: 10/10

Examples: Deep Glow, Trapcode Particular, Element 3D

  1. cta

  2. How to troubleshoot

  3. typos

  4. missing semi-colons

  5. uppercase or lowercase

  6. SourceRectAtTime

  7. how does it work?

  8. video

  9. when should you usw

01 Basics

  • How do use an expression

  • Do visit

  • No knowing what to do when there’s an error - troubleshooting

    • typo mistakes: wrong letter case for function, accidentally type wrong symbols such as "comma" for "dots"

Week 3 Troubleshooting

Week 4 Setups

  • string operations

Expressions focus: sourceRectAtTime, valueAtTime()

Assignment

  1. Recreate this workout counter from the Youtube workout video. Your setup should consist of

    • Use of one composition

    • The size of the boxes must be constant

    • Responsive sizing of text to the size of the box

  • Box Boy Lantern setup

  • Z-repeater

  • Random

  • Responsive lower-thirds

  • Cool stuff - Oscillations

Week 5: for Type

  • Recreating the Matrix

  • text-repeater : for loop statement

Week 6: for Automation responsive setup

Week 7: automation

  • spreadsheet to comp

Content

Data types

Variable var fruit = 🍎 or var 🍎,🍐,🍐 String "string is text" Array var fruits = [🍏,🍎,🍐,🍊,πŸ‹,🍌,πŸ‰,πŸ‡] Conditional if (fruit){ statement} else {statement} For for( i = 0; i < value ; i++) Object var x = {firstName:"John", lastName:"Doe"}; //

Develop

Functions

200 - level

Focus on building rigs and setups for the team

  • masterproperties

300 - level innovative solutions

  • simulation createPath

  • ​

  • visual analysis training, breaking down a reference animation, mastercopies

  • ludic experiments

  • "point" vision

  • building your repository and

350 - Scripting

  • ​