Skip to content

Instantly share code, notes, and snippets.

View animoplex's full-sized avatar
🎯
Animating!

Animoplex animoplex

🎯
Animating!
View GitHub Profile
@animoplex
animoplex / IfElseNumbers.jsx
Last active June 29, 2020 17:14
If / Else Statements (Numbers) - After Effects Expression by Animoplex
// If / Else Statements (Numbers) - Created by Animoplex: www.animoplex.com
// A collection of if/else statements using numbers.
// Variation A: Even Or Odd
// Determines if the input is an even or odd number, outputs based on the result.
num = effect("Slider Control")("Slider");
if ((num % 2) == 0) {
100;
} else {
@animoplex
animoplex / ClampValues.jsx
Last active January 14, 2023 00:33
Clamp Values - After Effects Expression by Animoplex
// Clamp Values - Created by Animoplex: www.animoplex.com
// Limits a slider or keyframable value with a minimum and maximum value clamp.
// Full Tutorial: https://www.youtube.com/watch?v=MITA3ygqvQY&t=313s
// Variation A: Slider (1 Value)
minVal = 0;
maxVal = 100;
clamp(effect("Size")("Slider"), minVal, maxVal)
@animoplex
animoplex / CursorWhileTyping.jsx
Last active May 7, 2025 19:30
Cursor While Typing - After Effects Expression by Animoplex
// Cursor While Typing - Created by Animoplex: www.animoplex.com
// Creates a pipe "|" symbol on a text layer while it types.
// NOTE: Add a Slider Control and Checkbox Control to your text layer and apply this to the "SourceText" parameter.
// NOTE: Keyframe the Slider Control from 0 to 100 to reveal the text being typed, the Checkbox toggles the cursor.
// Full Tutorial: https://www.youtube.com/watch?v=I-Acdl_l9G0&t=294s
src = effect("Slider Control")("Slider");
tog = effect("Checkbox Control")("Checkbox");
blink = Math.round(time % 1);
pipe = " ";
@animoplex
animoplex / DelayedOffset.jsx
Last active April 1, 2023 23:24
Delayed Offset - After Effects Expression by Animoplex
// Delayed Offset - Created by Animoplex: www.animoplex.com
// Delays an animation based on the layer above and the frames to delay.
// NOTE: Looks for an identical transform property on the layer above.
// NOTE: To change, replace "transform(thisProperty.name)" with your desired effect.
delay = 10; // Frames To Delay
above = thisComp.layer(index - 1).transform(thisProperty.name);
above.valueAtTime(time - framesToTime(delay))
@animoplex
animoplex / MarkerSyncExpression.jsx
Last active August 24, 2023 19:54
Marker Sync - After Effects Expression by Animoplex
// Marker Sync Expression
// Modified expression based on Dan Ebbert's Marker Sync Expression
// Original Version: http://www.motionscript.com/design-guide/marker-sync.html
// Full Tutorial: https://www.youtube.com/watch?v=B_3XS2-VWOM&t=698s
src = comp(name).layer("Markers");
n = 0;
if (marker.numKeys > 0) {
n = marker.nearestKey(time).index;
if (marker.key(n).time > time) {
@animoplex
animoplex / PseudoEffectXML.xml
Last active May 16, 2025 07:58
Pseudo Effect Via XML - After Effects Example XML by Animoplex
// Pseudo Effect Via XML - Example File
// Full Tutorial: https://www.youtube.com/watch?v=pHwBOFZgKcs&t=296s
// Edit the PresetEffects.xml for your version of After Effects to add Pseudo Effects.
// XML File Location on Windows:
// Program Files > Adobe > After Effects (Version) > Support Files
// XML File Location on OSX:
// Apps > After Effects > Right-click After Effects.app > “Show Contents” > Contents > Resources
@animoplex
animoplex / AfterEffectsJSON.json
Last active June 29, 2020 17:13
Example JSON File - After Effects JSON by Animoplex
// Example After Effects JSON File - Created by Animoplex: www.animoplex.com
// Full Tutorial: https://www.youtube.com/watch?v=Wkr_XOpsAFU&t=554s
{
"planet": {
"mercury": {
"name": "Mercury",
"radius": 2439.7,
"distance": {
"perihelion": 46001200,
@animoplex
animoplex / DistanceBasedOpacityFade.jsx
Last active April 11, 2018 21:03
Distance Based Opacity Fade - After Effects Expression by Animoplex
// 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;
@animoplex
animoplex / CountdownClock.jsx
Last active May 23, 2023 08:08
Countdown Clock - After Effects Expression by Animoplex
// 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
}
@animoplex
animoplex / DashesCircleStroke.jsx
Last active June 29, 2020 17:17
Fixed Dashes Around Circle Stroke - After Effects Expression by Animoplex
// 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