Adding a bounce expression to an imported png

Scripting for After Effects

Adding a bounce expression to an imported png

Postby gezzamondo on 05/19/2015, 7:33 am

i have a few animated pngs in my composition which give a popup effect, when i add a bounce expression to the orientation I get an error Image

Any idea how i can get this expression to work on this animation?

Code: Select all
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;
}
gezzamondo
 
Posts: 17
Joined: 05/2/2011, 12:50 pm

Re: Adding a bounce expression to an imported png

Postby star+circle on 05/24/2015, 3:51 am

Add it to the rotation property instead (Don't know if it works, just an idea).
star+circle
 
Posts: 781
Joined: 12/6/2014, 3:07 pm
Location: Finland


Return to After Effects Expressions