Add a slider to your first layer. This will save the times in which the layers appear. Add the following expression. You can modify at which key to start by changing the parameter in the key(2) : sTime = thisLayer.opacity.key(2).time;. numLayers is the number of child layers you have(exclude your main). maxDur is the maximum duration of the delay in seconds.
function getRandomTimes(sTime, numLayers, maxDur){
var crtTime = sTime;
var values = [sTime];
for(var i=1; i <=numLayers;i++){
seedRandom(1,true);
crtTime+=random(maxDur);
values.push(crtTime);
}
return values;
}
sTime = thisLayer.opacity.key(2).time;
numLayers = 7;
maxDur = 1;
var times = getRandomTimes(sTime, numLayers, maxDur);
val = 0;
i=0;
while (time>=times[i]){
val=i+1;
i++;
}
val
Then, to the following layers add this to opacity. firstLayerIndex is the index of your main layer in the current composition.
firstLayerIndex = 2;
index-firstLayerIndex <= thisComp.layer("Shape Layer 1").effect("Slider Control")("Slider") ? 100 : 0;
Andrei
My Envato portfolio.