Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Combining expressions on same layer

  • Combining expressions on same layer

    Posted by Sean Platt on October 16, 2015 at 5:05 pm

    Hi. I am new at learning expressions and trying to figure out how to combine to expressions on same layer. Essentially, I am trying to bounce an object into the frame from off stage and then begin to wiggle once it has finished the bounce. Any help would be greatly appreciated.


    <b>The first expression I am using is:</b>

    amp = .03;
    freq = 3.0;
    decay = 5.0;
    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 &lt; 1){
    v = velocityAtTime(key(n).time - thisComp.frameDuration/10);
    value + v*amp*Math.sin(freq*t*2*Math.PI)/Math.exp(decay*t);
    }else{value}

    <b>The second expression I want to add is:</b>

    wiggle(1,9)

    Sean Platt replied 10 years, 6 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    October 16, 2015 at 5:30 pm

    I would put the wiggle at the top of the expression (saving the actual wiggle amount into variable w):

    w = wiggle(1,9) – value;

    then add it in at the bottom like this:

    value + v*amp*Math.sin(freq*t*2*Math.PI)/Math.exp(decay*t) + w;
    }else{value + w}

    Dan

  • Sean Platt

    October 16, 2015 at 5:38 pm

    Dan, thank you so much. I hope I can get my head wrapped around this better someday.

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