-
Random lines expression crashes when i try to stop them
Hi Guys
I have used Dans Random lines expression to animate a load of lines, travelling accross the screen. I want to be able to bring to a stop, the movement of the lines, at some point in time. So i have created a null and assigned slider controls – A minSeg and maxSeg. However when i keyframe this to 0, AE just hangs and will evenuaully crash as i have so many layers.
The script i am applying is below.
Also, i would like to bring these animated lines on from outside the boundaries of the comp, as they will be going over vision. At present, i am positioning them off frame at Time 0sec. Is this the correct way to do this or does the expression need to be adapted.
Thanks alot
beginTime = thisComp.layer("Control").effect("Begin at")("Slider");if (time<=beginTime) {
value
}else {
t = time - beginTime;
tMin = thisComp.layer("Control").effect("Min Seg")("Slider"); //minimum segment duration
tMax = thisComp.layer("Control").effect("Max Seg")("Slider"); //maximum segment durationend = 0;
j = 0;
while (t >= end){
j++;
seedRandom(j,true);
start = end;
end += random(tMin,tMax);
}
endVal = random(thisComp.width);
seedRandom(j - 1,true);
x = random(); //this is a throw-away value
if (j > 1){
startVal = random()*this_comp.width;
}else{
startVal = value[0];
}
x = ease(t,start,end,startVal,endVal);
[x,value[1]]
}