Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions 2 Expressions, one slot

  • 2 Expressions, one slot

    Posted by Chris Taylor on April 1, 2015 at 4:30 pm

    Hi,

    I am trying to get these two expressions to work together. Currently, only the out animation (Bottom) is working. I would like to get them both working together based on the delay numbers.

    It is a scale expression I am using on a circle to get an overshoot effect.

    freq = 3;
    decay = 5;
    maxDelay = 1.0;
    outDelay = 4.0;

    Delay = maxDelay;
    t = time - (inPoint + Delay);
    startVal = [0,0];
    endVal = [100,100];
    dur = 0.1;
    if (t < dur){
    easeIn(t,0,dur,startVal,endVal);
    }else{
    amp = (endVal - startVal)/dur;
    w = freq*Math.PI*2;
    endVal + amp*(Math.sin((t-dur)*w)/Math.exp(decay*(t-dur))/w);

    }

    Delay = outDelay;
    t = time - (Delay);
    startVal = [100,100];
    endVal = [0,0];
    dur = 0.2;
    {
    easeIn(t,0,dur,startVal,endVal);
    }

    Dan Ebberts replied 11 years, 5 months ago 2 Members · 3 Replies
  • 3 Replies
  • Dan Ebberts

    April 1, 2015 at 5:12 pm

    Like this, I think:


    freq = 3;
    decay = 5;
    maxDelay = 1.0;
    outDelay = 4.0;
    if ((time - inPoint) < outDelay){
    Delay = maxDelay;
    t = time - (inPoint + Delay);
    startVal = [0,0];
    endVal = [100,100];
    dur = 0.1;
    if (t < dur){
    easeIn(t,0,dur,startVal,endVal);
    }else{
    amp = (endVal - startVal)/dur;
    w = freq*Math.PI*2;
    endVal + amp*(Math.sin((t-dur)*w)/Math.exp(decay*(t-dur))/w);
    }
    }else{
    Delay = outDelay;
    t = time - (Delay);
    startVal = [100,100];
    endVal = [0,0];
    dur = 0.2;
    easeIn(t,0,dur,startVal,endVal);
    }

    Dan

  • Chris Taylor

    April 1, 2015 at 7:35 pm

    Great cool thanks I’ll check it tomorrow.

    For future reference ” }else{” is used to bridge the expression?

    For example, if I was to add a wiggle exp to the scale it would be,
    }else{
    Wiggle(xx,xx,);
    }

  • Dan Ebberts

    April 1, 2015 at 7:44 pm

    That would work if your are replacing the second ease with the wiggle. If you wanted to add it, you would use “else if” and your expression would take the form:

    if (some condition){
    (expr 1)
    }else if (some other condition){
    (expr 2)
    }else{
    (expr 3)
    }

    Dan

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