-
Invalid numeric result (divide by zero) on a text source
Really odd one. I have the following code in a textSource property, to debug:
t = timeToFrames(time);
d = timeToFrames(thisComp.duration);
c = thisComp.layer("control").effect("running_tot")("Slider"); // float value
tot = thisComp.layer("control").effect("tot")("Slider"); // float value
ave = tot / d;
avetot = ave * t;
playhead = avetot / c;
"avetot: " + avetotThis works fine. However, if I replace the last line with
"c: " + cto see what value c has on a given frame, I get “invalid numeric result (divide by zero?)” pointing to that line.
I must be missing something really, really obvious, but I don’t know why I’m getting this error – I’m not trying to divide anything, just display a value!