Using Expressions in After Effects

Standard

In After Effects, the expressions are scripts that are able to modify dynamically the value of the transformations of a certain object. It is a common practice using expressions for simulating physics in animations and produce realistic effects. They are also very useful because a well written expression could be applied on any object that should replicate that behaviour.

Scripts in the tutorial:

BACKGROUND

v = thisComp.layer("slider").effect("Controllo cursore")("Cursore")*100;
y = v*time;
yMax = this.height -  thisComp.height;
if(Math.abs(y)<yMax ){
value - [0, y];
}else value - [0,yMax];

MAN (position)

pos=transform.position;
yMax = thisComp.layer("background").height-  thisComp.height;
v0 = thisComp.layer("slider").effect("Controllo cursore")("Cursore")*100;
t0 = yMax/v0;
if(time>t0){
t=time-t0;
y0 = thisComp.height/2;
amplitude = .9* thisComp.height;
period = 2*amplitude/v0;
omega = 2*Math.PI/period;
phase=0;
decay = 1/2;
y = amplitude*Math.sin(omega*t+phase)/Math.exp(t*decay) + y0;
x = amplitude*.09*Math.sin(omega*2*t)/Math.exp(t*decay) + pos[0];
[x,y]
}else value

MAN (rotation)

yMax = thisComp.layer("background").height-  thisComp.height;
v0 = thisComp.layer("slider").effect("Controllo cursore")("Cursore")*100;
t0 = yMax/v0;
t180 = .3*t0;
if(time<t180){
value+180*time/t180;
} else 180;

ROPE (initial point)

thisComp.layer("background").transform.position - value;

ROPE (end point)

thisComp.layer("bungeeMan").transform.position;

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