0% found this document useful (0 votes)
160 views9 pages

After Effects Expressions

The document provides several After Effects expressions for different animation effects: 1. Wiggle, Inertia Bounce, and Scale Bounce expressions use values like frequency and amplitude to generate animated wiggles or bounces based on keyframes. 2. Bounce Back and Drop Bounce expressions simulate bouncing physics with parameters like elasticity and gravity to bounce values back from keyframes. 3. Loop and number counting expressions are also included to loop layers or format number values from sliders with commas.

Uploaded by

cris18.mago
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
160 views9 pages

After Effects Expressions

The document provides several After Effects expressions for different animation effects: 1. Wiggle, Inertia Bounce, and Scale Bounce expressions use values like frequency and amplitude to generate animated wiggles or bounces based on keyframes. 2. Bounce Back and Drop Bounce expressions simulate bouncing physics with parameters like elasticity and gravity to bounce values back from keyframes. 3. Loop and number counting expressions are also included to loop layers or format number values from sliders with commas.

Uploaded by

cris18.mago
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 9

AFTER EFFECTS

EXPRESSIONS
WIGGLE
wiggle(frequency, amplitude)
Ex.
Wiggle(1, 10)
INERTIA BOUNCE
n = 0;
if (numKeys > 0){
n = nearestKey(time).index;
if (key(n).time > time){
n--;
}
}
if (n == 0){
t = 0;
}else{
t = time - key(n).time;
}

if (n > 0 && t < 1){


v = velocityAtTime(key(n).time - thisComp.frameDuration/10);
amp = .05;
freq = 4.0;
decay = 8.0;
value + v*amp*Math.sin(freq*t*2*Math.PI)/Math.exp(decay*t);
}else{
value;
}

COPY AND PASTE THE EXPRESSION. AMP, FREQ, AND DECAY CAN BE MODIFIED
BOUNCE BACK
e = .7;
g = 5000;
nMax = 9;

n = 0;
if (numKeys > 0){
n = nearestKey(time).index;
if (key(n).time > time) n--;
}
if (n > 0){
t = time - key(n).time;
v = -velocityAtTime(key(n).time - .001)*e;
vl = length(v);
if (value instanceof Array){
vu = (vl > 0) ? normalize(v) : [0,0,0];
}else{
vu = (v < 0) ? -1 : 1;
}
tCur = 0;
segDur = 2*vl/g;
tNext = segDur;
nb = 1; // number of bounces
while (tNext < t && nb <= nMax){
vl *= e;
segDur *= e;
tCur = tNext;
tNext += segDur;
nb++
}
if(nb <= nMax){
delta = t - tCur;
value + vu*delta*(vl - g*delta/2);
}else{
value
}
}else
value

COPY AND PASTE THE EXPRESSION. E and g CAN BE MODIFIED


DROP BOUNCE
e = .5;
g = 20000;
nMax = 9;

n = 0;
if (numKeys > 0){
n = nearestKey(time).index;
if (key(n).time > time) n--;
}
if (n > 0){
t = time - key(n).time;
v = -velocityAtTime(key(n).time - .001)*e;
vl = length(v);
if (value instanceof Array){
vu = (vl > 0) ? normalize(v) : [0,0,0];
}else{
vu = (v < 0) ? -1 : 1;
}
tCur = 0;
segDur = 2*vl/g;
tNext = segDur;
nb = 1; // number of bounces
while (tNext < t && nb <= nMax){
vl *= e;
segDur *= e;
tCur = tNext;
tNext += segDur;
nb++
}
if(nb <= nMax){
delta = t - tCur;
value + vu*delta*(vl - g*delta/2);
}else{
value
}
}else
value

COPY AND PASTE THE EXPRESSION. e AND g CAN BE MODIFIED


SCALE BOUNCE
amp = .1;
freq = 2.0;
decay = 5.0;
n = 0;
time_max = 4;
if (numKeys > 0){
n = nearestKey(time).index;
if (key(n).time > time){
n--;
}}
if (n == 0){ t = 0;
}else{
t = time - key(n).time;
}
if (n > 0 && t < time_max){
v = velocityAtTime(key(n).time - thisComp.frameDuration/10);
value + v*amp*Math.sin(freq*t*2*Math.PI)/Math.exp(decay*t);
}else{value}

COPY AND PASTE THE EXPRESSION.


LOOP (PINGPONG)
Make a key frame then loop using pingpong bounce
loopOut(“pingpong”)
Number counting
*note:copy these values to the source text

num = value; //highlight the value and drag the whiplash to the sider control

function addCommas(x) {
return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
}

addCommas(num)
Number counting 2
*note:copy these values to the source text

num = effect("Slider Control")("Slider").value.toFixed(0)


num + “prefix”
------------------------------------------------------------------------------------------------------
num = effect("Slider Control")("Slider").value.toFixed(0)
“suffix” + num + “suffix”
------------------------------------------------------------------------------------------------------

//number counting with comma and prefix/suffix


num = effect("Slider Control")("Slider").value.toFixed(0) .replace(/\B(?=(\d{3})+(?!\d))/g, ",");
“suffix” + num + “suffix”

You might also like