-
loopIn & loopOut a linear() expression
Hi!
I have this project where I need to have layer markers to determine when the loop point happen. The problem is that it is going to be a lot of duplicated layers with the exact same set up, and I need this to loopIn and loopOut, to still have looping animation before the first marker and after the second one.
Basically what I need is that if I have the first marker at time=0 and the second one at time=10, I want the timeremap to go from 0secs to 5secs between this two markers, and have it loopIn(“cycle”) and loopOut(“cycle”) with this new animation.
Right now I have this:
mark1 = thisLayer.marker.key(1).time;
mark2 = thisLayer.marker.key(2).time;
mark0 = mark1-(mark2-mark1);
pos1= 0;
pos2=10;
loopNumber = Math.floor(time/mark2);
if (mark1>0 && time<=mark1) {
linear(time, mark0,mark1,pos1,pos2)
} else if (time<mark2 && time>mark1){
linear(time,mark1,mark2,pos1,pos2)
} else {
mark1 = mark2*loopNumber;
mark2 = mark2*(loopNumber+1);
linear(time, mark1,mark2,pos1,pos2)
}
But for whatever reason it seems to jump frames at some point, so I can’t make it loop if I offset any of the layers.
Any idea??
Thank you!!
JaviG