Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions reverse loopOut() with linear()? reverse looping layer animation time remap?

  • reverse loopOut() with linear()? reverse looping layer animation time remap?

    Posted by Clifford Sonnentag on September 25, 2015 at 9:50 am

    I’m totally stumped why I can’t get after effects to do this. I just want it to loop my animation which it does fine with just loopOut(“cycle”,0);

    I can’t get this to work. I want to reverse the loop direction with a time remap on every other layer. Please help, i’m stuck. stuck stuck.

    I’ve tried every combo of the following 6 second clip loop in the time remap expression. if i get it to work then it loses or drops a frame in one of the animations.

    if ((index % 2) === 1) {
    loopOut(“cycle”,0);
    linear(time, 0, 6, key(1), key(2));
    }
    else {
    loopIn(“cycle”,0);
    linear(time, 0, 6, key(2), key(1));
    }

    Dan Ebberts replied 10 years, 7 months ago 2 Members · 4 Replies
  • 4 Replies
  • Clifford Sonnentag

    September 25, 2015 at 9:57 am

    tried this too:

    if ((index % 2) === 1) {
    loopOut(“cycle”,0);
    linear(time, 0, 6, key(1), key(2));
    }
    else {
    loopOut(“cycle”,0);
    linear(time, 0, 6, key(2), key(1));
    }

  • Dan Ebberts

    September 25, 2015 at 5:50 pm

    Try this:


    t = time%key(2).time;
    if (index%2)
    t
    else
    key(2).time - t

    Dan

  • Clifford Sonnentag

    September 25, 2015 at 11:30 pm

    thank you, it works, but it breaks down when I have to do all these workarounds to fix the looping animations that drop frames.

    with 4 keyframes it breaks down using these:

    t = time%key(2).time;
    if (index%2)
    t
    else
    key(2).time - t
    loopOut("cycle",2);


    loopOut("cycle",2);
    t = time%key(2).time;
    if (index%2)
    t
    else
    key(2).time - t

    I’ll have to revisit to understand what is going on because my brain is jello from figuring out what is going on with Adobe a Loop***()

    Thank you for all of your help Dan, I see you are quite the genius in this forum.

  • Dan Ebberts

    September 25, 2015 at 11:42 pm

    You can’t just put loopOut in an expression with other stuff and expect combined results. In your first example, none of the code before loopOut will have any effect. In your second example loopOut will have no effect at all. The result of an expression is always the very last thing it calculates. It is possible to incorporate the result of loopOut by plugging it into a variable that you use somewhere else, but I don’t know of many examples where that would be very useful.

    If you want a modified loop, your best bet is probably to just write your own looping code (which isn’t all that complicated) and forget about loopOut.

    Dan

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