Hello all, I am currently in the process of writing a tool for work that requires the need to read our in house.model format which is a binary file.
Here's the thing, the guy who wrote the tools that I inherited never finished them and never commented them so I have been hacking at the old code for a few months now which has been great fun and a brilliant learning process. He left an old file that seems like it reads a binary file which is exactly what I need. I am however confused over something involved reading the data in a binary file, so here goes. To get the information from the binary file it would appear that certain functions need to be called in a certain order. The only thing is all they essentially do is read the file in byte chunks. If I comment any of the functions out and run the code the data is all wrong. So my question is, when you are reading binary files (or any files) every time you perform a read function or a struct.unpack does the position in the file that you read from change? Or is it something simpler like if you have written your binary file in a certain way, you HAVE to read it in exactly the same way? I might be missing some crucial theory so any help would be much appreciated :) Here are the function calls and the loop that contains the reading of info: <script src="https://gist.github.com/anonymous/e2a8e69148b2bb8201c5.js"></script> And here is the function that I am using to loop through the file and gather the data: <script src="https://gist.github.com/anonymous/bf57cec25d9b21e667dc.js"></script> Cheers! I Would Be -- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/26738828-d7fe-45cf-9e28-2bae239f748b%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
