bmesh_simple_editmode.py 425 B

123456789101112131415161718192021222324
  1. # This example assumes we have a mesh object in edit-mode
  2. import bpy
  3. import bmesh
  4. # Get the active mesh
  5. obj = bpy.context.edit_object
  6. me = obj.data
  7. # Get a BMesh representation
  8. bm = bmesh.from_edit_mesh(me)
  9. bm.faces.active = None
  10. # Modify the BMesh, can do anything here...
  11. for v in bm.verts:
  12. v.co.x += 1.0
  13. # Show the updates in the viewport
  14. # and recalculate n-gon tessellation.
  15. bmesh.update_edit_mesh(me, True)