Skip to content

Instantly share code, notes, and snippets.

View animoplex's full-sized avatar
🎯
Animating!

Animoplex animoplex

🎯
Animating!
View GitHub Profile
@animoplex
animoplex / OutputDateTime.jsx
Last active June 29, 2020 17:10
Output Current Date & Time - After Effects Expression by Animoplex
// Output Current Date & Time - Created by Animoplex: www.animoplex.com
// Output the current system date on your computer via a text layer.
// Full Tutorial: https://www.youtube.com/watch?v=I-Acdl_l9G0&t=886s
d = new Date(Date(0));
day = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];
date = d.getMonth() + 1 + "/" + d.getDate() + "/" + d.getFullYear();
day[d.getDay()] + ", " + date
@animoplex
animoplex / EvaluateExternalFile.jsx
Last active June 29, 2020 17:13
Evaluate External File - After Effects Expression by Animoplex
// Evaluate External File - Created by Animoplex: www.animoplex.com
// Read and execute an expression from an external file.
// Full Tutorial: https://www.youtube.com/watch?v=Wkr_XOpsAFU&t=266s
myPath = "/D/Users/animoplex/Downloads/Expression.txt";
$.evalFile(myPath);
// Note: Quotation marks in this file must be straight quotes, not curly quotes.
@animoplex
animoplex / DynamicBox.jsx
Last active June 29, 2020 17:14
Dynamic Box - After Effects Expression by Animoplex
// Dynamic Box - Created by Animoplex: www.animoplex.com
// Apply this to the Size property of a shape layer to resize the box based on the source.
// Full Tutorial: https://www.youtube.com/watch?v=BOPfs49VfLE&t=803s
pad = 80; // pixel padding around box
src = thisComp.layer("Label");
box = src.sourceRectAtTime(time - src.inPoint);
[box.width + pad, box.height + pad]
@animoplex
animoplex / AutoFadeOpacity.jsx
Last active September 5, 2024 07:21
Auto Fade Opacity - After Effects Expression by Animoplex
// Auto Fade Opacity - Created by Animoplex: www.animoplex.com
// Automatically fades a layer in and out based on the inPoint and outPoint of the layer.
// Full Tutorial: https://www.youtube.com/watch?v=BOPfs49VfLE&t=188s
fade = 1; // fade duration in seconds
fadeIn = (time - inPoint) / fade;
fadeOut = (outPoint - time) / fade;
if (time < inPoint + fade) {
ease(fadeIn, 0, 1) * value;
} else if (time > outPoint - fade) {
@animoplex
animoplex / AfterEffectsArrayMethods.jsx
Last active August 22, 2022 11:09
After Effects Array Methods - After Effects Expression by Animoplex
// After Effects Array Methods - Created by Animoplex: www.animoplex.com
// List of compatible array methods in After Effects expressions and what they do.
// Full Tutorial: https://www.youtube.com/watch?v=l7Xd8mkqWfc&t=268s
// Output an array as a string separated with the argument's contents.
myArray.join(", ")
// Outputs a string with elements separated by commas.
myArray.toString()
@animoplex
animoplex / AfterEffectsStringMethods.jsx
Last active June 29, 2020 17:10
After Effects String Methods - After Effects Expression by Animoplex
// 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()
@animoplex
animoplex / MathMethods.jsx
Created April 16, 2018 16:02
JavaScript Math Methods - After Effects Expression by Animoplex
// JavaScript Math Methods - Created by Animoplex: www.animoplex.com
// List of math methods for After Effects expressions and what they output.
// 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
Math.max(1, 2, 3) // Returns 3
Math.round(1.49) // Returns 1
@animoplex
animoplex / SpeedVelocity.jsx
Last active June 29, 2020 17:19
Speed & Velocity - After Effects Expression by Animoplex
// Speed & Velocity - Created by Animoplex: www.animoplex.com
// A couple of examples of speed and velocity formatting.
// Full Tutorial: https://www.youtube.com/watch?v=47OWQmcez9M
// Speed
transform.position.speed
// Velocity
transform.position.velocity
@animoplex
animoplex / WiggleExpression.jsx
Created September 4, 2018 01:35
Wiggle Expression - After Effects Expression by Animoplex
// Wiggle Expression - Created by Animoplex: www.animoplex.com
// A basic wiggle expression for use on a property in After Effects.
// Full Tutorial: https://www.youtube.com/watch?v=AmmXDOFMjz8
// Wiggle Example
wiggle(2, 20)
// Steadicam Wiggle Example
wiggle(1, 10, 2, 0.25)
@animoplex
animoplex / TimeExpression.jsx
Created September 4, 2018 01:44
Time Expression - After Effects Expression by Animoplex
// Time Expression - Created by Animoplex: www.animoplex.com
// A basic time expression for use on a property in After Effects.
// Full Tutorial: https://www.youtube.com/watch?v=YLapbNyYxLs
// Time Example
time * 10
// Time + Wiggle Example
wiggle(5, time)