Expression to show next layer every X frames
I'm making a video where I talk to the camera with constantly cycling different lengths of hair. I recorded each scene entirely with different lengths of hair and some scenes have more takes than others. I would like to cycle through each layer (length of hair) changing to the next layer every frame. So far my method has been to have a "layer selector" slider on a separate layer that I animate with a loop expression and then tell each video layer to have this expression so the layer only becomes visible when the slider calls it's number
if(index==Math.round(thisComp.layer("Adjustment Layer 6").effect("Layer Selector")("Slider"))){100}else{0};
But this gets messy when the "layer selector" slider animates from say 2-6 and doesn't align exactly with the frames of the video and we get layers which show slightly longer than others. The frame rate is also something I'd like to experiment with so my goal would really be to have the "layer selector" slider use an expression rather than keyframes. Something like this is what I'm thinking:
var startlayer = 2
var endlayer = 6
var framerate = 3
loop from start to end changing every [framerate] frames
Any help much appreciated!
