Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Wiggle + bounce effects on scale

  • Wiggle + bounce effects on scale

    Posted by Martín Riera on March 14, 2019 at 6:43 pm

    Hello to everyone,

    I’m quite new on after effects scripts and this could be an easy question for most of you but for me is something impossible to solve. I would like to use in a layer two different animations on Scale, on one side a wiggle that should be working all the time; on the other side, at second 9 the layer’ scale gets increase and I want to use a bounce effect on it. I tried these two functions independently and they work well, but when I write both together on the Scale scripts just works one of them…

    How can I use more than one function on the same script, this is a limit that I always have when using scripts?

    Thanks!!

    Martin R.

    /*Animation1*/
    w = wiggle(5,3);
    [w[0],w[0]]

    /*Animation2*/
    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;
    }

    Martín Riera replied 7 years, 1 month ago 2 Members · 2 Replies
  • 2 Replies
  • Tomas Bumbulevičius

    March 14, 2019 at 9:33 pm

    Martin,

    expression can generate only one final property driving result. Instead, consider one of the followings:

    a) Add ‘Transform’ effect to a layer and apply wiggle effect to its scale transformation (If its selected to Uniform scale, use only wiggle(5,3) without further array).
    b) Add null, place it at the center of a layer, parent layer to null and apply wiggle.

    On the layer, add the second expression to scale. Its a workaround, but should solve it.

    Find out more:
    After Effects Tutorials: motion design, expressions, scripting.

  • Martín Riera

    March 19, 2019 at 7:28 pm

    Thanks Thomas! Useful videos there, I think I’ll use them 😀

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