fredag den 22. november 2019

Rebound bounce

With this expression, you can create a rebound effect of the object from the floor. Allows you to animate almost any parameter.


e = .3; // Bouncing
g = 1; // Gravity
nMax = 10; // Maximum bounces

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*1000);
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*1000)*delta/2);
}else{
value
}
}else
value

Damping - Bounce

One of the most popular expressions for After Effects. It allows animate virtually any parameter with a damping effect.


amp = .04;// The higher the value, the greater the amplitude
freq = 2;// The higher the value, the higher the frequency
decay = 5;// The higher the value, the smaller the delay

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){
v = velocityAtTime(key(n).time - thisComp.frameDuration/10);
value + v*amp*Math.sin(freq*t*2*Math.PI)/Math.exp(decay*t);
}else{
value;
}

tirsdag den 14. juni 2016

New Camera Orientation expression

//Put Expression in Orintation

L = thisComp.layer("Camera 1"); 
u = fromWorldVec(L.toWorldVec([1,0,0])); 
v = fromWorldVec(L.toWorldVec([0,1,0])); 
w = normalize(fromWorldVec(L.toWorldVec([0,0,1])));

sinb = clamp(w[0],-1,1);
b = Math.asin(sinb);
cosb = Math.cos(b); 
if (Math.abs(cosb) > .0005){
 c = -Math.atan2(v[0],u[0]); 
 a = -Math.atan2(w[1],w[2]); 
}else{
 a = (sinb < 0 ? -1 : 1)*Math.atan2(u[1],v[1]); c = 0; 
}
[radiansToDegrees(a),radiansToDegrees(b),radiansToDegrees(c)]


// by on creativecow Sep 8, 2012 at 2:54:19 am

torsdag den 10. september 2015

Delay from parent

//Redgiant.com
// Harry Frank

(was put in the Position Expresion)

delay=0.2;
parent.fromWorld(toWorld([0,0,0],time-delay));

mandag den 25. november 2013

Rotate + time extra

Thats just for making it to rotate over time from 0 and in timeline 0

-time*1.3

This if for makeing it start from a value and then adding a time offset

(value-time*1.3)

Getting world space coordinates - Comp space - Comp Coordinate

Lets call this one.... Beam Glue

Have been looking for this Expression for a long time, but finaly i found it.
This one is for linking stuff together, that is allready parented fx Beam Between 2 Nulls

//2d
//Video copilote
//ngambles

lay = (pickwhip the child null layer) ;
pos = lay.toWorld( lay.anchorPoint);

And another one (with extra control)


//2d
//Mograph.net
//iline

lay = thisComp.layer("Parent NULL")
wrld=lay.toWorld(lay.anchorPoint);
[wrld[0],wrld[1]]



//3D
//Dan Ebberts

L = thisComp.layer("Solid 1");
P = L.toWorld(L.anchorPoint);
Where P[0] =x,P[1] =y, and P[2] =z

torsdag den 26. september 2013

AE POSTWORK blog is virtually just a notepad, where I put all the AE expressions up I finde and use, its so I can easily get to them wherever I am and no matter what computer I sit at. I do not write my own expressions, so all expressions on the page is downloaded from the web,or modify versions i found. and tutorials etc.. I will try to credit those who have made expressions if I can.

Now, with tips and tricks for AE & C4D.
No more forgetting the little tricks and tips I found on my road with After Effects, etc.

Sebabba