ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Complex Linear loop

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Doni Donovan
Complex Linear loop
on Dec 10, 2018 at 3:55:37 am
Last 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;

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

Return to posts index

Dan Ebberts
Re: Complex Linear loop
on 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);


Return to posts index

Doni Donovan
Re: Complex Linear loop
on Dec 10, 2018 at 7:38:50 am

Wooow you realy jenius Dan!
thanks a lot from Indonesia

Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2019 All Rights Reserved