Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions how apply inertial bounce on parented layer

  • how apply inertial bounce on parented layer

    Posted by Fernando Huezo on May 20, 2015 at 5:38 pm

    Hi there!
    I need help with something
    I want know how to apply a inertial bounce expression on parented layer
    I tried only apply the expression but it does not work, only using keyframes in the own layer.
    Some idea?

    Fernando Huezo replied 10 years, 12 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    May 20, 2015 at 7:22 pm

    Assuming the keyframes are on the layer’s parent’s position property, something like this could work:


    freq = 3;
    decay = 5;

    p = parent.transform.position;
    n = 0;
    if (p.numKeys > 0){
    n = p.nearestKey(time).index;
    if (p.key(n).time > time) n--;
    }
    if (n > 0){
    t = time - p.key(n).time;
    p1 = toWorld(anchorPoint,p.key(n).time);
    p0 = toWorld(anchorPoint,p.key(n).time - .01);
    amp = (p1 - p0)/.01;
    w = freq*Math.PI*2;
    value + amp*(Math.sin(t*w)/Math.exp(decay*t)/w);
    }else
    value

    Dan

  • Fernando Huezo

    May 20, 2015 at 8:10 pm

    Its works!
    I just change the P value for the slider that control the X position, Here is where are the keyframes, I guess that is much easier if I apply the values on the null position and define the lowest and highest distance.

    Thank you very much!

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