-
Making the opacity to switch on and off – should be easy.
Yes, I am new to this…
I have a precomp I want to switch the opacity to 0 and 100 for every e.g. 10th frame. That is, 0% for the 10 first frames, then 100% for the next 10 frames and back to 0% for the next 10 frames and so on…
I tried the following expression but I guess that the state variable is initialized for every new frame. Thus, the opacity stays at 100% for 10 frames, switching to 0% for one frame, and then switching back to 100% for the next 10 frames and so on.
How (if possible) do I prevent the state variable to be initialized for every new frame, or solve this problem?
frames = timeToFrames() % 10;
state = 1;if (frames == 0)
state = state * -1;if (state == 1)
f = 1;
else
f = 0;transform.opacity = 100*f;