-
AE CC 2014.1.1 Random divid by zero error in expression?
Has anyone come across this? I’ve been using this intertial bounce script by Dan for years now with no issues, but today using a new version of AE, when I apply the intertial bounce expression to a parameter and then scrub in the timeline a little, I suddenly get an error message stating “An error at line 16, (divide by zero?)”
I’ve never seen this error before, but it happens randomly as I scrub through the timeline, and it immediately disables the expression. Anyone know whats going on? I’m working on a project last minute over the weekend and this is really screwing me over right now. Any help on this would be greatly appreciated.
Below is the script i’ve been using:
amp = .1;
freq = 2.0;
decay = 8.0;
n = 0;if (numKeys > 0)
{n = nearestKey(time).index;
if (key(n).time > time){
n--;
}}
if (n == 0){ t = 0;}
else{t = time - key(n).time;
}
if (n > 0){
v = velocityAtTime(key(n).time - thisComp.frameDuration/10);
value + v*amp*Math.sin(freq*t*2*Math.PI)/Math.exp(decay*t); \\This is line 16 where the error is
}else{value}