I'm working on a C++/Direct3D game engine now, and I'd like to make an export script for bring blender models to the engine. But I wouldn't like to use common model formats, I'd like to use custom one in hexadecimal format. Although, I haven't got any experience in Python scripting, so I modify one of the built-in scripts in the blender directory. This is the RAW exporter. Originally the raw_export.py has got the tag 'wb' that makes the export of the data to binary format, but it is somehow in decimal format. Yes, and the content of the file could be modified by hex editor. I don't know that you could understand me, but the format should'nt be string. It must be in binary format if I'm understandable. And a little problem. When I modify the display format from %f %f %f to %f%f%f, there will be dots between the values instead of spaces. But I don't like them at all, but I could ignore this problem by modify the code in C++, but i would like to ignore them. And is there a way to reverse the byte order in the floats? Thanks!
ehhm. sorry for english, i'M 14 now.
For reading and writing binary data, the Python struct module it your friend. It will also do big endian/little endian conversion.
1. do the tutorial in the doc section at www.python.org
2. look at the docs for the struct module. it has examples.