I wrote a small script that swaps 2 digits of all vertex positions of a mesh.
The problem: when I assign the new position to the mesh it is not the same number I assigned.
Here are some example numbers. The first number is the original x vertex position. The second number is calculate thorugh swapping 2 digits right before the decimal point. The third number is the printed vertex position after I assigned it to the mesh. The number I assigned is not the same as the one I calculated…
I dont know if this is a precision problem or the floats getting rounded by blender somehow.
271.59722900390625 275.1972290039063 275.1972351074219 271.59722900390625 275.1972290039063 275.1972351074219 264.8992919921875 268.49929199218747 268.4992980957031
Here the code where I assign the new position:
for mesh in bpy.data.meshes: for v in mesh.vertices: print(v.co.x) print(flipVertex(v.co.x)) v.co.x = flipVertex(v.co.x) v.co.y = flipVertex(v.co.y) v.co.z = flipVertex(v.co.z) print(v.co.x) print("")