As preparation for my GSoC project (faster Import/Export), this will improve the import testing.
- Hashes more data (the old one only hashed the vertex coordinates)
- Order independent
Hashing is slightly slower, due to hashing more of the mesh's data. (Hashing is still faster than importing.)
Order independence is achieved by sorting the data first, so this might still result in problems for meshes with duplicate vertices.
This diff is not done yet, since I first wanted to ask whether it is okay to do it this way. But the things that are done work.
The big change is hashing the binary data directly instead of converting to a string, which was the really slow part about this. (I intend to test with bigger meshes than those included in the repos already.)
I think the reason for hashing strings was reproducibility on different platforms.
However, since all platforms use IEEE 754 floats as far as I know, when importing floats stored in binary, data should not change at all.
Also, floats stored as text should ideally also round-trip correctly. Nonetheless I have included an option to round.
Also, converting to a string does not really solve the problem of small inaccuracies, because if the binary data is slightly different, it might round to a different number. It just makes it less likely.
- Is it okay to do it this way?
- How to hash vertex groups efficiently
- Endianess correction