ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Dan Ebbert's Squash and Stretch on marker not working correctly

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Andrey Sibiryakov
Dan Ebbert's Squash and Stretch on marker not working correctly
on Sep 8, 2012 at 9:32:31 pm

Hello.

I've combined two expressions one - Dan Ebbert's Squash and Stretch.

Only thing it is doing wrong - is doubling scale when assigned.
Where is a mistake?

Thanks in advance.

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=35; //speed of oscillation
decay=10; //how fast it slows down
t = time - marker.key(n).time;
x = scale[0] + spd*Math.sin(max_dev*t*2*Math.PI)/Math.exp(decay*t);
y = (1/x)*10000;
value + [x,y];
}


Return to posts index

Dan Ebberts
Re: Dan Ebbert's Squash and Stretch on marker not working correctly
on Sep 9, 2012 at 1:02:24 am

It looks to me like you've got spd and max_dev swapped. (spd should be inside Math.sin() and max_dev should be outside).

Dan



Return to posts index

Andrey Sibiryakov
Re: Dan Ebbert's Squash and Stretch on marker not working correctly
on Sep 9, 2012 at 6:43:07 am

Replaced values.
Unfortunately, didn't work.


Return to posts index


Dan Ebberts
Re: Dan Ebbert's Squash and Stretch on marker not working correctly
on Sep 9, 2012 at 7:09:54 am

This works for me.


Dan

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=35; //speed of oscillation
decay=10; //how fast it slows down
t = time - marker.key(n).time;
x = scale[0] + max_dev*Math.sin(spd*t*2*Math.PI)/Math.exp(decay*t);
y = (1/x)*10000;
[x,y];
}




Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2019 CreativeCOW.net All Rights Reserved
[TOP]