Skip to content

Instantly share code, notes, and snippets.

View animoplex's full-sized avatar
🎯
Animating!

Animoplex animoplex

🎯
Animating!
View GitHub Profile
@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 / LoopExpression.jsx
Created September 4, 2018 01:57
Loop Expression - After Effects Expression by Animoplex
// Loop Expression - Created by Animoplex: www.animoplex.com
// Basic loop expressions for use on a property in After Effects.
// Full Tutorial: https://www.youtube.com/watch?v=XRrs9pvWGuY
// Loop Examples
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.
@animoplex
animoplex / InertialBounce.jsx
Last active July 19, 2024 04:43
Inertial Bounce - After Effects Expression by Animoplex
// Inertial Bounce - Created by Animoplex: www.animoplex.com
// Original Version: http://www.graymachine.com/top-5-effects-expressions/
// Modified expression for a smoother bounce effect and easier editing. Use this on any property with two keyframes to get a nice bounce effect that is based on velocity of the value change. Perfect for a scale from 0 to 100 or a speedy rotation that needs some extra life. Adjust amp, freq and decay values to tweak the effect. Amp is intensity, freq is bounces per second, and decay is the speed of decay, slow to fast.
// Full Tutorial: https://www.youtube.com/watch?v=653lxeVIyoo
amp = 5.0; freq = 2.0; decay = 4.0;
n = 0;
if (numKeys > 0) {
n = nearestKey(time).index;
@animoplex
animoplex / CursorWhileTyping.jsx
Last active June 23, 2024 21:34
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 / SimpleTriggerFade.jsx
Created December 22, 2018 00:59
Simple Trigger Fade - After Effects Expression by Animoplex
// Simple Trigger Fade - Created by Animoplex: www.animoplex.com
// Repeat a fade animation multiple times using markers to trigger the animation.
// Full Tutorial: https://www.youtube.com/watch?v=B_3XS2-VWOM
fadeFrames = 30; m = 0; t = time;
if (marker.numKeys > 0) {
m = marker.nearestKey(time).index;
tag = marker.key(m).comment;
if (tag == "In") { t = marker.key(m).time - time }
else if (tag == "Out") { t = time - marker.key(m).time }
@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 / 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 / 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 / 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 / SampleLumaValue.jsx
Last active March 30, 2023 12:26
Sample Luminance Value - After Effects Expression by Animoplex
// Sample Luminance Value - Created by Animoplex: www.animoplex.com
// Samples the luma value of a defined area and converts to a specified value within a range.
// Use samplePoint to specify luma location
// Use sampleSize to adjust the sample area
// Last line: 0 - 1 is input, 0 - 100 is output
// Full Tutorial: https://www.youtube.com/watch?v=QkqiaPZJa1Y&t=62s
target = comp("SOURCE COMP").layer("SOURCE LAYER");
samplePoint= [960,540]; // Sample location
sampleSize= [50,50]; // Sample area (in pixels)