The trick is to calculate the random timing in one place, and “publish” it for the other properties to use as random seeds. This generally requires two pieces of information, so you can apply a Point Control to the layer with an expression like this:
minDuration = 0.3;
maxDuration = 0.9;
minVal = inPoint;
maxVal = outPoint – maxDuration;
n = 0;
seedRandom(index, true);
preRun = random(maxDuration);
tEnd = -preRun;
while (time > tEnd){
n++;
seedRandom(n, true);
dur = random(minDuration, maxDuration);
tStart = tEnd
tEnd += dur;
}
[tStart,tEnd]
Then you can use expressions like this on the properties where you want to sync the randomization:
// uniform scale
ptCtrl = effect(“Point Control”)(“Point”);
tStart = ptCtrl[0];
tEnd = ptCtrl[1];
minVal = 50;
maxVal = 200;
seedRandom(tStart,true);
startVal = random(minVal,maxVal);
seedRandom(tEnd,true);
endVal = random(minVal,maxVal);
s = linear(time,tStart,tEnd,startVal,endVal);
[s,s]
// non-uniform scale
ptCtrl = effect(“Point Control”)(“Point”);
tStart = ptCtrl[0];
tEnd = ptCtrl[1];
minVal = [50,50];
maxVal = [200,200];
seedRandom(tStart,true);
startVal = random(minVal,maxVal);
seedRandom(tEnd,true);
endVal = random(minVal,maxVal);
linear(time,tStart,tEnd,startVal,endVal);
// rotation
ptCtrl = effect(“Point Control”)(“Point”);
tStart = ptCtrl[0];
tEnd = ptCtrl[1];
minVal = -360;
maxVal = 360;
seedRandom(tStart,true);
startVal = random(minVal,maxVal);
seedRandom(tEnd,true);
endVal = random(minVal,maxVal);
linear(time,tStart,tEnd,startVal,endVal);
// position
ptCtrl = effect(“Point Control”)(“Point”);
tStart = ptCtrl[0];
tEnd = ptCtrl[1];
minVal = [width,height]/2;
maxVal = [thisComp.width,thisComp.height] – minVal;
seedRandom(tStart,true);
startVal = random(minVal,maxVal);
seedRandom(tEnd,true);
endVal = random(minVal,maxVal);
linear(time,tStart,tEnd,startVal,endVal);
// opacity
ptCtrl = effect(“Point Control”)(“Point”);
tStart = ptCtrl[0];
tEnd = ptCtrl[1];
minVal = 25;
maxVal = 100;
seedRandom(tStart,true);
startVal = random(minVal,maxVal);
seedRandom(tEnd,true);
endVal = random(minVal,maxVal);
linear(time,tStart,tEnd,startVal,endVal);
Generally (except for uniform scale) you just need to update minVal and maxVal to fit the property.
Dan