Skip to content

Instantly share code, notes, and snippets.

View animoplex's full-sized avatar
🎯
Animating!

Animoplex animoplex

🎯
Animating!
View GitHub Profile
@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 / InertialBounce.jsx
Last active January 24, 2024 16:35
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 / 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 / CursorWhileTyping.jsx
Last active August 10, 2023 21:52
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 / AutoFadeOpacity.jsx
Last active August 10, 2023 00:30
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 / 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)
@animoplex
animoplex / 3Dto2DPosition.jsx
Last active January 29, 2023 09:41
3D to 2D Position - After Effects Expression by Animoplex
// 3D to 2D Position - Created by Animoplex: www.animoplex.com
// Give 2D effects or properties the ability to use 3D positioning in After Effects.
// toComp is a layer space transform method that transforms values from a layer space to a composition space.
// Full Tutorial: https://www.youtube.com/watch?v=FVrgLK6Zovw&t=268s
src = thisComp.layer('Layer 1');
src.toComp([0,0,0]);