Skip to content

Instantly share code, notes, and snippets.

@zeffii
Created May 29, 2013 07:57
Show Gist options
  • Save zeffii/5668669 to your computer and use it in GitHub Desktop.
Save zeffii/5668669 to your computer and use it in GitHub Desktop.
import bpy, bmesh
obj = bpy.context.object
bm = bmesh.from_edit_mesh(obj.data)
bm.verts.new((2.0, 2.0, 2.0))
bm.verts.new((-2.0, 2.0, 2.0))
bm.verts.new((-2.0, -2.0, 2.0))
bm.faces.new((bm.verts[i] for i in range(-3,0)))
bm.verts.new((2.0, 2.0, -2.0))
bm.verts.new((-2.0, 2.0, -2.0))
bm.verts.new((-2.0, -2.0, -2.0))
bm.verts.new((2.0, -2.0, -2.0))
bm.faces.new((bm.verts[i] for i in range(-4,0)))
# update, while in edit mode
bmesh.update_edit_mesh(obj.data)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment