Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Converting Robert Penner’s easing into expressions

  • Converting Robert Penner’s easing into expressions

    Posted by Amir Aizat on December 29, 2017 at 10:53 am

    Hi,

    I’m having problems making Robert Penner’s easing work with After Effects:

    function easeInQuint(t, b, c, d) {
    return c*(t/=d)*t*t*t*t + b;
    }

    easeInQuint(time - inPoint, [0,0], [100, 100], inPoint + 1);

    It kept moving indefinitely, not stopping at [100, 100] or inPoint + 1.

    function easeInQuint(t, b, c, d) {
    return c*(t/=d)*t*t*t*t + b;
    }

    x = easeInQuint(0, 0, 1, 1);

    linear(x, [0,0], [100, 100])

    This doesn’t respond at all.

    What did I do wrong for this expression? My goal is to use this as a replacement for boring ease() / easeIn() / easeOut() interpolation.

    EDIT:

    I managed to make it somewhat work, but I don’t understand it completely yet. The full expression is:

    var comp = thisComp;

    var duration = comp.layer("Duration").text.sourceText;
    var transition = comp.layer("Transition").text.sourceText;

    duration = parseFloat(duration); // testing at 1
    transition = parseFloat(transition); // testing at 1

    var startDuration = inPoint + transition; // 1
    var actualDuration = startDuration + duration + transition; // 3
    var endDuration = actualDuration - transition; // 2

    var startPos = [0, 0];
    var endPos = [960, 0];

    if (time <= (inPoint + actualDuration) / 2) { smoothEaseOut(inPoint, startDuration, startPos, endPos); // 0, 1, [0, 0], [960, 0] } else { smoothEaseIn(endDuration, actualDuration, endPos, startPos); // 2, 3 [960, 0], [0, 0] } function easeOutQuint(t, b, c, d) { return c*((t=t/d-1)*t*t*t*t + 1) + b; } function easeInQuint(t, b, c, d) { return c*(t/=d)*t*t*t*t + b; } function smoothEaseIn(startTime, endTime, startVal, endVal) { var x = easeInQuint(time - startTime, 0, 1, transition); return linear(x, startTime, endTime, startVal, endVal); } function smoothEaseOut(startTime, endTime, startVal, endVal) { var x = easeOutQuint(time - startTime, 0, 1, transition); return linear(x, startTime, endTime, startVal, endVal); }

    The transition and duration are supposed to be adjustable by keying in time in seconds in Premiere Pro's live text template settings, and the entire things worked properly with normal ease, or when I use ease within ease multiple times (not sure what that technique is called).

    With the quint easing function, transition and duration changes break the curves, and animation out isn't working at all. Any help would be greatly appreciated.

    EDIT:

    Graph for reference

    Thank you.

    Yoan Boisjoli replied 3 weeks, 2 days ago 2 Members · 2 Replies
  • 2 Replies
  • Amir Aizat

    January 4, 2018 at 12:40 pm

    I found the problem. Posting the solution for people who’s had the same issue

    instead of
    function smoothEaseIn(startTime, endTime, startVal, endVal) {
    var x = easeInQuint(time - startTime, 0, 100, transition);
    return linear(x, startTime, endTime, startVal, endVal);
    }

    function smoothEaseOut(startTime, endTime, startVal, endVal) {
    var x = easeOutQuint(time - startTime, 0, 100, transition);
    return linear(x, startTime, endTime, startVal, endVal);
    }

    it should be
    function smoothEaseIn(startTime, endTime, startVal, endVal) {
    var x = easeInQuint(time - startTime, 0, 100, transition);
    return linear(x, 0, 100, startVal, endVal);
    }

    function smoothEaseOut(startTime, endTime, startVal, endVal) {
    var x = easeOutQuint(time - startTime, 0, 100, transition);
    return linear(x, 0, 100, startVal, endVal);
    }

    Stupid mistake on my part, I can’t believe I missed that!

  • Yoan Boisjoli

    April 4, 2025 at 12:37 am

    Hey Amir,

    I know this post is a few years old, but I stumbled on it while digging into Penner easings in AE a while back. Totally feel your pain and I hit the same wall when trying to integrate those curves cleanly into expressions, especially for MOGRTs where linear() and ease() just weren’t giving enough control.

    That frustration actually led me to build a script called Keyless. It lets you animate with Penner easings and full timing control, but without setting keyframes. It auto-detects the property type and sets up the easing using expression controllers instead.

    If anyone’s still looking for a way to simplify this kind of setup, here’s the tool:

    https://aescripts.com/keyless/

    Just launched it this week and would love feedback from folks who’ve gone deep into this kind of thing.

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