-
Randomly fade up/down opacity of masks in a layer
So I have a basic expression that will change opacity according to a slider control. Basically as written below, as the master slider traverses 20%-30%, the layer or mask this is applied to will fade up from 0%-100%.
transComplete = effect(“Mask Fade Controls”)(“Transition Completion”);
linear(transComplete, 20, 30, 0, 100)
So that works as expected, however what I’d ultimately like to do is apply this to a bunch of masks on a layer, where each one will get a random start point for its fade so that they all fade up at random times. So my first attempt at that looks like this…
start = random(1,90);
transComplete = effect(“Mask Fade Controls”)(“Transition Completion”);
linear(transComplete, start, start + 10, 0, 100)
Now if I apply this expression to all of my masks, then move the slider control back and forth between 0-100 it works just as expected. However, if I then try to keyframe the 0-100 values of the slider over time, then all of my masks flicker on/off. My assumption is because the expression is being read every frame on playback and the start variable is resetting to a new value each time through the random function. Is my thinking correct there?
If so, I need to find a way to randomize a value once, but then keep that value constant throughout the rest of playback.