Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions loopOut on keyframes AND modifying them with the linear() expression

  • Dan Ebberts

    June 18, 2024 at 3:04 pm

    I think that would be like this:

    first = key(2).value;
    second = key(3).value;
    newValue = effect("Length 25-80")("Slider");
    d = key(numKeys).time - key(1).time;
    if (time < key(1).time){
    t = key(numKeys).time - (key(1).time - time)%d;
    }else if (time > key(numKeys).time){
    t = key(1).time + (time - key(numKeys).time)%d;
    }else{
    t = time;
    }
    linear(valueAtTime(t), first, second, first, newValue);
  • Patrick Grossien

    June 20, 2024 at 10:01 am

    It works like a charm! Thank you so, so much, Dan!

  • Brie Clayton

    June 20, 2024 at 2:21 pm

    Thanks for this solve, Dan!

  • Patrick Grossien

    June 27, 2024 at 8:36 am

    If I may follow up on this, could you – or someone else who can – explain to me the modulo operation? I still am not sure if I can wrap my head around it.

    t = time%key(numKeys).time;

    Let me try though:

    – take the duration spanning all keyframes of the current property:

    key(numKeys).time

    – let “t” loop from 0 to x in time increments every time the above keyframe duration fitted into “time”.

    So if I have keyframes ranging over 2 seconds, at 2:01 “t” will start to count from 0 to 2 in the same way as “time” would and do that over and over again.

    Is this correct? At least that would make sense to me, I guess 😂

  • Dan Ebberts

    June 27, 2024 at 12:29 pm

    That’s pretty much it. I used that simple form in the first expression because I was assuming that the first keyframe was at time = zero. If that isn’t the case, you have to use the more complex form that involves the times of both the first and last keyframes.

  • Patrick Grossien

    June 28, 2024 at 8:00 am

    That was perfect and totally what I intended in the beginning. The extending both ways part came later when I realized it could be extremely practical.

    Thank you so so much for all your help – past, present and future 🙂

Page 2 of 2

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