ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Complex Linear loop

FAQ   •   VIEW ALL
 Complex Linear loop on Dec 10, 2018 at 3:55:37 amLast Edited By Doni Donovan on Dec 10, 2018 at 4:21:15 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;

//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);
}

 Re: Complex Linear loopon Dec 10, 2018 at 7:16: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