Hey guys. I really need your help in this one. It goes like this:
when i import a *.stl file the coordinates of the vertices get written under object.data.vertices but they do NOT get updated when i move, rotate or scale the object (i am guessing for the operations to run smoother and feel “lighter”). Instead the information about those transformations are kept in the object.matrix_world. With a little bit of coding one can form a new matrix to house the “real or updated” coordinates of an object. The big problem is when i try to assign new values to vertex coordinates of a moved object. For example :
bpy.ops.transform.translate(value=(0,0,10)) #moving object
obj.data.vertices.co=-10 #should be setting the vertex 0 of the cube to -10 but no…
The last line of code should mean get that vertex to z=-10, right? Not to 0… It cannot be relative to the object’s current position because the program does not know it since it does not update the obj.data.vertices matrix. What am i doing wrong? What i want to achieve for those wondering is to produce a result similar to that of the “To Sphere” operator which is in edit mode under Mesh->Transform->To Sphere (Shift Alt S).