Struct.pack fails with negative numbers

Scripting in Blender with Python, and working on the API

Moderators: jesterKing, stiv

Post Reply
Posts: 0
Joined: Wed Aug 07, 2013 8:32 pm

Struct.pack fails with negative numbers

Post by Hardcheese »


I have a problem with the Blender data exporter for my model format where whenever I call 'struct.pack("<I", -1)' the code fails with the following error code:

Struct.error: argument out of range

Do you know how to solve this problem? Any replies are appreciated.

Posts: 0
Joined: Sun Apr 05, 2009 7:42 pm
Location: Germany

Post by CoDEmanX »

I stands for unsigned int, it can't be negative. Use lower case i
I'm sitting, waiting, wishing, building Blender in superstition...

Post Reply