-
After Effects error: Unsafe Operation Attempted ( 58 :: 0 )
Keep getting this error in CS5 and can’t seem to isolate where it’s coming from or how to avoid it. End up having to force quit After Effects to get out of the error loop. Think it might have something to do with the sampleImage(); command but not sure.
Any help would be greatly appreciated!
timeEnabled = thisComp.layer("Controls").effect("Enable Time Offset")("Checkbox");
restartEnabled = thisComp.layer("Controls").effect("Restart Time")("Checkbox");frameOffset = thisComp.layer("Controls").effect("Frame Offset")("Slider");
if(timeEnabled > 0){
n = name.slice(2);
tile = thisComp.layer("m_" + n)
targetLayer =thisComp.layer("Controls").effect("Map")("Layer")
samplePoint = tile.transform.position
sampleRadius = [1,1];
above = false;if(restartEnabled>0){
for (f = timeToFrames(); f>= timeToFrames(inPoint); f--){
t = framesToTime(f);
sampledColor_8bpc = 255 * targetLayer.sampleImage(samplePoint, sampleRadius,true,t);
R = Math.round(sampledColor_8bpc[0]);if (R>1 ){
above = true; break;
}
}
}else{for (f = timeToFrames(inPoint); f<=timeToFrames(); f++){
t = framesToTime(f);
sampledColor_8bpc = 255 * targetLayer.sampleImage(samplePoint, sampleRadius,true,t);
R = Math.round(sampledColor_8bpc[0]);if (R==0){
t = t - framesToTime(1);
above = true; break;
}}
}if (above) time - t + framesToTime(frameOffset) else 0;
}else{
time;
}