Cage opened this issue on Dec 20, 2006 ยท 1232 posts
adp001 posted Thu, 13 March 2008 at 9:06 AM
Data conversion isn't a problem. There is a module called "struct" made to move data between Python and C-structures. Part of Python since ever. I'm using this to transport data between Poser and external Apps.
Try this:
import struct
X=1.2345
Y=3.567890
Z=7.3434673453
packedpoint=struct.pack("3f",X,Y,Z)
print packedpoint, len(packedpoint)
print struct.calcsize("3f")
X,Y,Z = struct.unpack("3f",packedpoint)
"3f" means: 3 floats. See http://docs.python.org/lib/module-struct.html
Above the 3 float vars (X,Y,Z) are packed in one string (packedpoint). The needed length of the string is explored via "calcsize(