User:Pluke/blender/basic mexh
< User:Pluke | blender
verts= [(-1,2,-0),(1,2,0),(-1,-2,0),(1,-2,0)]
faces =[(0,1,3,2)]
mesh = bpy.data.meshes.new("square")
object = bpy.data.objects.new("square", mesh)
object.location = bpy.context.scene.cursor_location
bpy.context.scene.objects.link(object)
mesh.from_pydata(verts, [], faces)
mesh.update(calc_edges=True)