bmesh py api: add bmesh.update_edit_mode(), there was no way to redraw the 3d view or re-calculate face tessellation from python.

add py template for editing meshes in editmode.

also remove double call to CTX_wm_region which does a string lookup.
This commit is contained in:
Campbell Barton
2012-11-29 05:02:06 +00:00
parent ede703ab85
commit 858149d7c7
4 changed files with 78 additions and 7 deletions

View File

@@ -0,0 +1,23 @@
# This example assumes we have a mesh object in edit-mode
import bpy
import bmesh
# Get the active mesh
obj = bpy.context.edit_object
me = obj.data
# Get a BMesh representation
bm = bmesh.from_edit_mesh(me)
bm.faces.active = None
# Modify the BMesh, can do anything here...
for v in bm.verts:
v.co.x += 1.0
# Show the updates in the viewport
# and recalculate n-gon tessellation.
bmesh.update_edit_mesh(me, True)