-
Is there a way to make a slider value into a range?
I currently have a composition that contains 95 identical lights in their “ON” state that are on top of their “OFF” counterpart in a frame that goes around a Logo. I found a very handy bit of expression here in the forums (below) to attach each “ON” light’s opacity to one slider outside of the comp that will turn on only the layer that corresponds to the slider value. However, I’d like to have a strip of 5 (or more) lights on at the same time, and the easiest way I can think of doing this is if there is an expression I can put into my slider saying “use this value plus/minus 2.” Does such an expression exist? Or is there another/easier way to achieve this same effect?
C = comp(Comp);
ctrl = C.layer(Layer).effect("Slider Control")("Slider");
L = C.layer(thisComp.name);
val = Math.round(ctrl.valueAtTime(time+L.startTime));
if (val == index) 100 else 0