This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Value Expression | |
value / 2 | |
// Current property value divided by 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Linear Counterbalance | |
s = thisComp.layer("Control").effect("Slider Control")("Slider"); | |
a = transform.position; | |
b = thisComp.layer("Null").toWorld([0,0,0]); | |
linear(s, 0, 100, a, b) | |
// Adjust a Slider Control (from 0 to 100) to balance between two values (a and b) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Linear & Ease Expressions | |
linear(time, outPoint - 2, outPoint, 100, 0) | |
ease(transform.opacity, 0, 100, 25, 75) | |
// Linear fade from 100 to 0 for the last 2 seconds of a layer’s duration | |
// Ease from 25 to 75 as the Opacity input animates from 0 to 100 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Loop Expressions | |
loopOut("cycle", 0) // Repeat from start to finish, default loop mode | |
loopOut("pingpong", 2) // Loops last three keyframes back and forth | |
loopOut("offset", 0) // Repeats animation using last keyframe as new start point | |
loopOut("continue") // Does not loop, but continues onwards with current velocity | |
// loopOut evaluates from the first keyframe towards the layer outPoint | |
// loopIn can be substituted to evaluate from layer inPoint towards last keyframe |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// JavaScript While Loop Example - Created by Animoplex: www.animoplex.com | |
// The JavaScript While Loop and how it can be used in After Effects. | |
// Full Tutorial: https://www.youtube.com/watch?v=SG3NyHmfc0s&t=225s | |
src = thisComp.layer("Control").effect("Acceleration")("Slider"); | |
dur = thisComp.frameDuration; | |
dist = 0; | |
t = 0; | |
while (t < time) { | |
dist += src.valueAtTime(t) * dur; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Math Methods - Created by Animoplex: www.animoplex.com | |
// Use these methods to manipulate properties and numerical values in After Effects. | |
// Full Tutorial: https://www.youtube.com/watch?v=aIxnJBOhdBw | |
// Math Method Examples | |
// Note: You must capitalize the M in Math for these methods to work properly. | |
Math.abs(-2) // Returns 2 | |
Math.ceil(1.01) // Returns 2 | |
Math.floor(1.99) // Returns 1 | |
Math.min(1, 2, 3) // Returns 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// After Effects String Methods - Created by Animoplex: www.animoplex.com | |
// List of compatible string methods in After Effects expressions and what they do. | |
// Full Tutorial: https://www.youtube.com/watch?v=l7Xd8mkqWfc&t=268s | |
// Outputs 2 characters, starting after the first character. | |
myString.substr(1, 2) | |
// Outputs everything after the first character, through the second character. | |
myString.substring() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Add Lightness - Created by Animoplex: www.animoplex.com | |
// Adds lightness percentage to a color value. | |
// Full Tutorial: https://www.youtube.com/watch?v=QkqiaPZJa1Y | |
// Lightness Example | |
moreLight = effect("Color Brightness")("Slider") / 100; | |
hsl = rgbToHsl(value); | |
assemble = [hsl[0], hsl[1], hsl[2] + moreLight, hsl[3]]; | |
hslToRgb(assemble) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// JavaScript For Loop Example - Created by Animoplex: www.animoplex.com | |
// The JavaScript For Loop and how it can be used in After Effects. | |
// Full Tutorial: https://www.youtube.com/watch?v=SG3NyHmfc0s&t=91s | |
myArray = []; | |
for (i = 0; i < thisComp.numLayers; i++) { | |
myArray[i] = thisComp.layer(i+1).name; | |
} | |
myArray.slice(0, thisComp.numLayers).join("\r") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Trim Decimals with toFixed() - Created by Animoplex: www.animoplex.com | |
// Trim to a specific number of decimal places and add zeros if the value is a whole number. | |
// Full Tutorial: https://www.youtube.com/watch?v=aIxnJBOhdBw | |
// Trim Decimals Example | |
value.toFixed(2) // Outputs a value of, for example, 1 as 1.00 and 1.667 as 1.66 | |
// Text String Trim Decimals Example | |
parseInt(text.sourceText).toFixed(2) // Converts text to string and trims decimals |