Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Adding Overshoot expression to Scale expression

  • Adding Overshoot expression to Scale expression

    Posted by Obed Ampong on March 4, 2023 at 1:36 am

    Hello, please, is there any way I could add this overshoot expression above to my scale expression below

    try {

    amp = effect(“Scale – Overshoot”)(“ADBE Slider Control-0001”) / 2.5, freq = effect(“Scale – Bounce”)(“ADBE Slider Control-0001”) / 20, decay = effect(“Scale – Friction”)(“ADBE Slider Control-0001”) / 20, n = 0, 0 < numKeys && (n = nearestKey(time)

    .index, key(n)

    .time > time && n–), t = 0 === n ? 0 : time – key(n)

    .time, 0 < n ? (v = velocityAtTime(key(n)

    .time – thisComp.frameDuration / 10), value + v / 100 * amp * Math.sin(freq * t * 2 * Math.PI) / Math.exp(decay * t)) : value;

    } catch (e$$4) {

    value = value;

    }

    Scale Expression

    function easeInOutCubic(t, tMin, tMax, value1, value2){

    b = value1;

    c = value2-b;

    d = tMax-tMin;

    t = tMin < tMax ? thisLayer.linear(t,tMin,tMax,0,d) : thisLayer.linear(t,tMin,tMax,d,0);

    t /= d/2;

    if (t <1) return c/2*Math.pow(t,3) + b;

    t -= 2;

    return c/2*(Math.pow(t,3) + 2) + b;

    }

    duration = .47;

    start=[0,0,0];

    destination = [100,100,100];

    exit = [0,0,-0];

    middle = (inPoint+outPoint)/2;

    v = time < middle ? easeInOutCubic(time,inPoint,inPoint+duration,start,destination) : easeInOutCubic(time,outPoint-duration,outPoint,destination,exit);

    Thank you

    Regards,

    Obed

    Dan Ebberts
    replied 1 year, 9 months ago
    2 Members · 8 Replies
  • 8 Replies
  • Dan Ebberts

    March 4, 2023 at 1:44 am

    I don’t think it will work, because your easeInOut expression has zero velocity at the end of the ease, and overshoot depends on incoming velocity.

  • Obed Ampong

    March 4, 2023 at 1:50 am

    Hi Dan,

    Ok. Please is there any way I could add it to the inPoint only?

    Regards,

    Obed

  • Dan Ebberts

    March 4, 2023 at 3:07 am

    I’m not sure I understand what you mean, but an easeInOut has zero velocity at both ends, so I’m guessing no.

  • Obed Ampong

    March 4, 2023 at 3:33 am

    Please, I am trying to scale from 0 to 100 instead of keyframe, then overshoot and maintain 100 until layer outPoint goes back to 0.

  • Dan Ebberts

    March 4, 2023 at 4:59 am
  • Obed Ampong

    March 4, 2023 at 1:24 pm

    Ok, Dan.

    Thank you.

    Regards,

    Obed

  • Obed Ampong

    March 7, 2023 at 3:51 pm

    Hello Dan,

    I tried modifying your scalar bounce expression by adding outPoint to it, where the outPoint and the inPoint have the same value. However, the overshoot failed to work. Is there any possible way to do this? Thank you. :

    freq = 3;

    decay = 5;

    t = time – inPoint;

    startVal = [0,0];

    exit =[0,0]

    endVal = [effect(“Slider Control”)(“Slider”),effect(“Slider Control”)(“Slider”)];

    dur = 0.1;

    if (t < dur){

    linear(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);

    }

    middle = (inPoint+outPoint)/2;

    v = time < middle ? easeIn(time,inPoint,inPoint+dur,startVal,endVal) : easeOut(time,outPoint-dur,outPoint,endVal,exit);

    v

    Regards,

    Obed

  • Dan Ebberts

    March 7, 2023 at 10:04 pm

    What is it exactly that you want to happen? It’s not clear to mean from what you’ve described so far…

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