What is the python way to select vertices of a mesh?
I've tried:
for vert in obj.data.vertices:
vert.select = True
I ran the above code in edit mode, but the vertices didn't turn yellow.
What is the python way to select vertices of a mesh?
I've tried:
for vert in obj.data.vertices:
vert.select = True
I ran the above code in edit mode, but the vertices didn't turn yellow.
import bpy,bmesh
ob = bpy.data.objects['Cube']
mesh = bmesh.from_edit_mesh(ob.data)
for v in mesh.verts:
v.select = True
# trigger viewport update
bpy.context.scene.objects.active = bpy.context.scene.objects.active
ob
variable?
$\endgroup$
bpy.data.objects['Cube']
, for instance, where it's accessed again in bmesh.from_edit_mesh(ob.data)
$\endgroup$