View MathMethods.jsx
// 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
View AfterEffectsStringMethods.jsx
// After Effects String Methods - Created by Animoplex: www.animoplex.com
// List of compatible string methods in After Effects expressions and what they do.
// Outputs 2 characters, starting after the first character.
myString.substr(1, 2)
// Outputs everything after the first character, through the second character.
myString.substring()
// Converts the string to all uppercase letters.
View AfterEffectsArrayMethods.jsx
// After Effects Array Methods - Created by Animoplex: www.animoplex.com
// List of compatible array methods in After Effects expressions and what they do.
// Output an array as a string separated with the argument's contents.
myArray.join(", ")
// Outputs a string with elements separated by commas.
myArray.toString()
// Sort an array alphabetically or numerically.
View AutoFadeOpacity.jsx
// 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) {
View DynamicBox.jsx
// 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]
View EvaluateExternalFile.jsx
// 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.
View OutputDateTime.jsx
// 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
View DashesCircleStroke.jsx
// Fixed Dashes Around Circle Stroke - Created by Animoplex: www.animoplex.com
// Apply this to a Ellipse shape layer's Stroke Dash property.
// Full Tutorial: https://www.youtube.com/watch?v=I-Acdl_l9G0&t=562s
src = effect("Slider Control")("Slider");
rad = content("Ellipse").content("Ellipse Path").size[0] / 2;
gap = content("Ellipse").content("Stroke").dash.gap;
seg = src <= 0 ? 1 : src;
2 * Math.PI * rad / seg - gap
View CountdownClock.jsx
// Countdown Clock
// Original: http://www.motionscript.com/design-guide/up-down-clock.html
rate = -1;
clockStart = 3.00;
sign = "";
function padZero(n) {
if (n < 10) {
return "0" + n
}
View DistanceBasedOpacityFade.jsx
// Distance Based Opacity Fade
// Original: https://helpx.adobe.com/after-effects/using/expression-examples.html
// Full Tutorial: https://www.youtube.com/watch?v=I-Acdl_l9G0&t=14s
startFade = 500;
endFade = 3000;
try {
C = thisComp.activeCamera.toWorld([0,0,0]);
} catch(err) {
w = thisComp.width * thisComp.pixelAspect;