Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Complex Linear loop

  • Complex Linear loop

    Posted by Doni Donovan on December 10, 2018 at 3:55 am

    Can anyone help me how to make this script looping?
    I am try to create animation by put a script on time remap to make it loop and have a delay on each loop.
    i only can make it loop manually but it will make the code super long, so i need to make it more simple, and i only need to set the delay and “s” for animation length.

    delay = 2;
    s = 1;

    //sliders values
    var m1 = 0;
    var m2 = s;
    var m3 = m2+delay;
    var m4 = m3+s;
    var m5 = m4+delay;
    var m6 = m5+s;
    var m7 = m6+delay;

    //keyframes in your original composition
    //change these numbers depending on the key moments of your composition
    var k1 = 0;
    var k2 = s;

    if(time < m2) { linear(time, m1, m2, k1, k2); } else if(time < m3) { linear(time, m2, m3, k2, k2); } else if(time < m4) { linear(time, m3, m4, k1, k2); } else if(time < m5) { linear(time, m4, m5, k2, k2); }else if(time < m6) { linear(time, m5, m6, k1, k2); }else { linear(time, m6, m7, k2, k2); }

    Doni Donovan replied 7 years, 7 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    December 10, 2018 at 7:16 am

    I’m not exactly sure, but I think it will be something like this:

    delay = 2;
    s = 1;
    k1 = 0;
    k2 = s;
    t = time%(s + delay);
    linear(t,0,s,k1,k2)

    Dan

  • Doni Donovan

    December 10, 2018 at 7:38 am

    Wooow you realy jenius Dan!
    thanks a lot from Indonesia

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