Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Scale Expression with inertia bounce – start from zero

  • Scale Expression with inertia bounce – start from zero

    Posted by Justin Alexander on October 20, 2011 at 10:14 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.

    Regards

    Justin Alexander

    Justin Alexander replied 14 years, 6 months ago 2 Members · 2 Replies
  • 2 Replies
  • Roland R. kahlenberg

    October 21, 2011 at 5:51 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.

    HTH
    RoRK

    Intensive AE & Mocha Training in Singapore and Malaysia.

  • Justin Alexander

    October 21, 2011 at 7:41 am

    Thanks for the heads up.

    I hate making newbie misstakes

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy