After Effects: Stop/Start at Markers and Loop

2k views Asked by At

I have a looping composition with Time Remapping and the following snippet in the Expression language menu:

loopOut(type = "cycle", numKeyframes = 0);

I would like to build a script, which stops and starts the composition at specific markers (i.e. at Odd Markers = Stop, and at Even = Play). This should keep the little snippet below into consideration.

I managed to do it for two markers but not for an infinite number...

m = thisLayer.marker;
if (m.numKeys > 1){
  if (time < m.key(1).time)
    time
  else if (time < m.key(2).time)
    m.key(1).time
  else
    m.key(1).time + (time - m.key(2).time);
}else{
  value
}

Do you have any ideas on how to expand its functionality?

Many thanks!

0

There are 0 answers