Thread: New DDP Export
View Single Post
Old 07-23-2011, 02:38 AM   #115
ElCongelador
Human being with feelings
 
ElCongelador's Avatar
 
Join Date: Mar 2010
Posts: 106
Default I think I fixed gofer's script

Quote:
Originally Posted by gofer View Post
Alas, nope. That guy actually does have a division by zero in his code. I can't find any possibility of that in the DDP script. At the moment I am going through all kinds of versions with Timlloyd. Currently it looks like the error was introduced with the input box (and the math done with the values).
I just checked the script (I'm on OS X).

the error happens in line 97 of your script: framediv = item_endpos / framesize

framesize is here 0, hence the division by zero error

Why is framesize zero? You set it to 1 / 75 at line 8 of your script, but here's the catch: It seems Python treats this as an integer division, so framesize is an integer and set to zero. So I think it's not a OS X / Windows thing but a Pyhton version discrepancy: the default OS X Python version is 2.6 (which I'm running) - and you're running version 3.1, which might handle integer/float values differently. I'm not a Python programmer, so perhaps someone can chime in on this.

Here's the solution: tell Python it's a float value:
framesize = 1.0 / 75.0

Last edited by ElCongelador; 07-23-2011 at 02:41 AM. Reason: typo
ElCongelador is offline   Reply With Quote