Skip navigation

Trigger expression-driven actions by adding markers on a layer (* on number keypad).

Pendelum swing: (put in the rotation)

n = 0;
 if (marker.numKeys > 0){
 n = marker.nearestKey(time).index;
 if (marker.key(n).time > time){
 n--;
 }
 }
 if (n == 0){
 value;
 } else {
 veloc = 10;  //how fast it swings
 amplitude = 100;  //how high
 decay = 4;
 t = time - marker.key(n).time;
 s= amplitude*Math.sin(veloc*t)/Math.exp(decay*t);
 value + s;
 }

Bounce: (put in the scale attribute)

n = 0;
 if (marker.numKeys > 0){
 n = marker.nearestKey(time).index;
 if (marker.key(n).time > time){
 n--;
 }
 }
 if (n == 0){
 value;
 } else {
 max_dev=20; // max deviation in pixels
 spd=20; //speed of oscillation
 decay=6; //how fast it slows down
 t = time - marker.key(n).time;
 s = max_dev*Math.sin(spd*(t))/Math.exp(decay*t);
 value + [s,s];
 }

Kudos: http://www.motion-graphics-exchange.com/after-effects/Expressions-triggered-by-a-marker/49983ed7989ae

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: