ADOBE AFTER EFFECTS: Forum Expressions Tutorials Podcasts Creative Cloud

Scale Expression with inertia bounce - start from zero

COW Forums : Adobe After Effects

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Justin AlexanderScale Expression with inertia bounce - start from zero
by on Oct 20, 2011 at 10:14:07 pm

Hi everyone,

I have been using these forums for a long while and found them to be immeasurably helpful.

What I am trying to do now is get a layer to scale in and scale out at its in and out points, along with a bit of an inertia spring.

I have used one of Dan Ebberts scripts from one of the posts here and modified it a bit to work at in and out points.

The problem I am having is that the layer needs to be constantly re-sized to get somewhat reasonable results. Most of the time it bounces out OK although it never seems to really get to 0% scale. The in point is the one that doesn't work properly though. Rarely can I get it to start at 0% scale. I have to have the layer scaled to the right size and tweak the 'Scale' setting in the expression. I normally have the variable set to sliders but have replaced them with my default settings here for easier dissecting.

I have the following script on a solid scaled at 40% in a 1050 x 576 comp. Solid was made comp size as I want this to work at any scale.

S =100; // Scale
A =20; // Amplitude
F =20; // Fequency
to = outPoint - time;
ti = time - inPoint;
inTrans = x=S*(1-Math.exp(-A*ti)*Math.cos(F*ti));
outTrans = y=S*(1-Math.exp(-A*to)*Math.cos(F*to));
value+ [inTrans,inTrans] + [outTrans,outTrans];

What I want to accomplish is to have the layer start at 0& scale and ramp up to whatever I set before applying the script. Then have a bit of inertia bounce that can be adjusted for intensity and length. At the minute the inertia bounce is working beautifully, I just need the scale to start and finish a 0%.

Then I want to be able to save it as a preset and have it save me hours of time over the next couple of years.

Really hope that I have made sense and that someone is able to tell me where I have gone wrong.


Justin Alexander

Return to posts index

Roland R. KahlenbergRe: Scale Expression with inertia bounce - start from zero
by on Oct 21, 2011 at 5:51:32 am

Justin, why don't you post this in the COW's AE Expressions Forum? Dan does drop by here on occasions, but you're more than likely to get a reply from him there.


Intensive AE & Mocha Training in Singapore and Malaysia.

Return to posts index

Justin AlexanderRe: Scale Expression with inertia bounce - start from zero
by on Oct 21, 2011 at 7:41:00 am

Thanks for the heads up.

I hate making newbie misstakes

Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2016 All Rights Reserved