Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Consecutive Interpolation expressions

  • Consecutive Interpolation expressions

    Posted by Paul Ducco on February 14, 2023 at 3:09 am

    Hi…is it possible to ‘line up interpolated expressions, so…

    expression one — Eases the scale of the layer to 150%

    expression two (which only happens when expression one is finished) — then scales to 80%, or perhaps also changes position?


    <font face=”inherit”>hope this makes sense. I’m aware I can do so with keyframes…there is method to my madness I </font>promise<font face=”inherit”> </font>

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

    February 14, 2023 at 4:27 am

    You can only control one property with a single expression, but you could do what you’re suggesting with scale. For example, you could have an expressions that eases from 100% to 150% from 1 second to 2 seconds, and then eases from 150% to 80% from 2 seconds to 3 seconds like this

    if (time < 2)
    s = ease(time,1,2,100,150)
    else
    s = ease(time,2,3,150,80);
    [s,s]

    Instead of hard-coding the times into the expression, you could control them with sliders, markers, or keyframes. You’d need to pin it down more to get more specific…

  • Paul Ducco

    February 14, 2023 at 4:35 am

    Thanks so much (as always) Dan.

    I must be on the right track, but not doing the right thing in my code…as that’s the approach I’d got to.
    Will have another tinker and post the code back here if I fail again.

  • Paul Ducco

    February 14, 2023 at 5:26 am

    Failing Dan. Help appreciated.

    This is resulting in the scale down occuring…then nothing, despite the arguments appearing to return as they would need to, to get scaler in the ‘else’ statement happening


    clickPoint= thisLayer.marker.nearestKey(time).time;

    keyLabel = thisLayer.marker.nearestKey(time).comment;

    clickDur = 0.15;

    t = time;

    defaultscale = valueAtTime(0)[0].toFixed();

    clickScale = (effect("Click Scale (%)")("Slider")/100).toFixed(1)

    clickBase = defaultscale*clickScale;


    if (valueAtTime(time)!=clickBase) {

    scaler = easeIn(t, clickPoint-clickDur, clickPoint, defaultscale, clickBase);

    } else {

    scaler = easeOut(t, clickPoint, clickPoint+clickDur, clickBase, defaultscale);

    }

    [scaler,scaler]

  • Dan Ebberts

    February 14, 2023 at 7:02 am

    I haven’t figured out exactly what it’s doing, but it seems that you would want to replace this:

    if (valueAtTime(time)!=clickBase) {

    with this:

    if (time < clickPoint) {
  • Paul Ducco

    February 14, 2023 at 9:28 am

    Haha. That’s concerning (for me!)
    I was attempting to say if the value (scale) of the layer was at the appropriate reduced amount (calculated with a value set by a slider), then animate.

    And as expected, your approach works beautifully and makes much more sense.

    Thankyou!

    Here’s where I got to if you’re interested in working out the madness…:)

    clickPoint= thisLayer.marker.nearestKey(time).time;

    keyLabel = thisLayer.marker.nearestKey(time).comment;

    clickDur = 0.075;

    t = time;

    defaultscale = value[0];

    clickScale = (effect("Click Scale (%)")("Slider")/100)

    clickBase = defaultscale*clickScale;

    if (time < clickPoint) {

    scaler = ease(t, clickPoint-clickDur, clickPoint, defaultscale, clickBase);

    }

    if (time >= clickPoint) {

    scaler = linear(t, clickPoint, clickPoint+clickDur, clickBase, defaultscale);

    }

    [scaler,scaler]

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