I have a mesh with 1.5M vertices, and I'm trying to round off vertex positions to reduce the filesize of my exported .obj file. Each vertex has a very high level of precision, which I don't really need for this project. For example, I have a vertex at
[492.98198, 382.19873, 274.98789], and would like to run a Python script to round it to
[493, 382, 275], effectively reducing my output by over 50%!
Is there a python script that I could run to round off all 1.5M of my vertices in one go? This is as far as I've gone:
for vertex in bpy.data.meshes['meshname'].vertices: vertex.co = round(vertex.co, 0) vertex.co = round(vertex.co, 0) vertex.co = round(vertex.co, 0)
But it seems like I can't really change the vertex values this way because
mesh.vertices is a readonly attribute.
Anybody know how to modify the script so my vertices all snap to the nearest integer?