Well, the problem is here:
[email protected]
So here you have used an operator @
. Like adding +
or multiplying *
it gets 2 entities, makes an operation with them and results a new entity. The @
operator applies a transformation matrix on vector v.co
and the result of this operation is saved in co
property. So instead of linking the data it creates new data, so that assigning something to co
doesn't make sense, because it holds a modified copy, not the link.
I suppose you can solve this like this:
import bpy
import bmesh
# import new module
import copy
obj=bpy.context.edit_object
m=obj.data
bm=bmesh.from_edit_mesh(m)
print("---")
for i in range(0,8):
v=bm.verts[i]
[email protected]
print(co.x)
co.x=2
print(co.x)
# get a copy of transform matrix to be able to invert it:
inverted = copy.copy(obj.matrix_world)
inverted.invert()
# now write property to the cube
v.co = inverted @ co
bmesh.update_edit_mesh(m)
I have used inverted matrix to write coordinates back.