-
Making a null toggle another layer's opacity… With a fade
Hi,
I have a few specific “states” needed in my composition, and I’m using a Slider control on a Null to toggle those states.
A slider value of “1” toggles the opacity of layers A, B and C to 100, the others to 0.
A slider value of “2” toggles the opacity of layers D, E and F to 100, the others to 0.
A slider value of “3” toggles the opacity of layers G, H and I to 100, the others to 0.I’m using keyframes on the Null to change the slider value between 1, 2 and 3 depending on which set of layers I need to be at full opacity.
However I would like for the change happening at each toggle to be eased over 1 second, rather than happen abruptly.
I feel I am close with this expression (added to each layer’s opacity), however using ‘time’ doesn’t quite cut it because, I believe, as the expression is constantly recalculated, the fade is restarted at every frame.
starttime = time;
endtime = starttime + 1;
if(thisComp.layer("Null").effect("Slider Control")("Slider") ==1) {easeOut(time,starttime,endtime,0,100)} else {(time,starttime,endtime,100,0)};
Many thanks.