Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions How to change the amount of influence or amount of ease on easeOut interpolation expression

  • How to change the amount of influence or amount of ease on easeOut interpolation expression

    Posted by Keith Endow on July 18, 2017 at 2:16 pm

    I’m trying to animate a countdown timer with a v1 being 99 and it animating down to a value fed in through a slider control for v2.

    I have two keyframes which drive the easeOut expression but can’t seem to figure out how to control the amount of ease.

    It feels like a 0-20 ease in but I’d like to make it feel more like a 0-80 ease. If that makes any sense.

    Here is the current expression I’m tinkering with:

    if (numKeys > 1){
    t1 = key(1).time;
    t2 = key(2).time;
    v1 = 99;
    v2 = thisComp.layer("CONTROLLER").effect("COUNT_DOWN_NUMBER")("Slider");
    easeOut(time,t1,t2,v1,v2);
    }else
    value

    Dan Ebberts replied 9 years, 1 month ago 2 Members · 5 Replies
  • 5 Replies
  • Dan Ebberts

    July 18, 2017 at 9:01 pm

    You can’t control the influence directly, but you can compound the ease, like this:


    if (numKeys > 1){
    t1 = key(1).time;
    t2 = key(2).time;
    v1 = 99;
    v2 = thisComp.layer("CONTROLLER").effect("COUNT_DOWN_NUMBER")("Slider");
    t = easeOut(time,t1,t2,0,1);
    easeOut(t,0,1,v1,v2);
    }else
    value

    Alternatively, you could implement one of the Penner ease functions.

    Dan

  • Keith Endow

    July 18, 2017 at 9:48 pm

    Thank you Dan!

    Would you know where I can read up more on how to implement Penner’s functions in this situation?

  • Dan Ebberts

    July 18, 2017 at 9:53 pm

    There’s a lot of info out there. This is one source:

    https://gizma.com/easing/

    There are also some links here:

    https://robertpenner.com/easing/

    If you have Ease and Wizz, you can look at what it does.

    Dan

  • Keith Endow

    July 19, 2017 at 4:06 pm

    Just downloaded and loaded Ease and Wizz. What an awesome script!

    So now that I’m looking at the code, is there any way to have a slider control change the values of the keyframes?

    SliderPoint = thisComp.layer("CONTROLLER").effect("BLACK_BOX_LENGTH")("Slider");

    // Ease and Wizz 2.5.2 : outExpo : All keyframes
    // Ian Haigh (https://aescripts.com/ease-and-wizz/)
    // Last built: 2017-01-09T15:35:09+11:00

    function easeandwizz_outExpo(t, b, c, d) {
    var OUT_EXPO_CORRECTION = 1.000976;
    return (t==d) ? b+c : c * OUT_EXPO_CORRECTION * (-Math.pow(2, -10 * t/(d)) + 1) + b;
    }

    function easeAndWizz() {
    var n = 0;
    if (numKeys > 0) {
    n = nearestKey(time).index;
    if (key(n).time > time) { n-- }
    }

    try {
    var key1 = key(n);
    var key2 = key(n+1);
    } catch(e) {
    return null;
    }

    // determine how many dimensions the keyframes need
    var dim = 1; // It's gotta have at least ONE dimension
    try {
    key(1)[1];
    dim = 2;
    key(1)[2];
    dim = 3;
    } catch(e) {}

    t = time - key1.time;
    d = key2.time - key1.time;

    sX = key1[0];
    eX = key2[0] - key1[0];

    if (dim >= 2) {
    sY = key1[1];
    eY = key2[1] - key1[1];

    if (dim >= 3) {
    sZ = key1[2];
    eZ = key2[2] - key1[2];
    }
    }

    if ((time < key1.time) || (time > key2.time)) {
    return value;
    } else {
    val1 = easeandwizz_outExpo(t, sX, eX, d);
    switch (dim) {
    case 1:
    return val1;
    break;
    case 2:
    val2 = easeandwizz_outExpo(t, sY, eY, d);
    return [val1, val2];
    break;
    case 3:
    val2 = easeandwizz_outExpo(t, sY, eY, d);
    val3 = easeandwizz_outExpo(t, sZ, eZ, d);
    return [val1, val2, val3];
    break;
    default:
    return null;
    }
    }
    }

    (easeAndWizz() || value);

  • Dan Ebberts

    July 19, 2017 at 6:13 pm

    I guess you’d have to get in there and swap out the sX, sY, sz, eX, eY, and eZ values. It might be easier to build your own based on the formula in the first function.

    Dan

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