Created
December 11, 2016 18:18
-
-
Save pcote/db291daa3d6bd60b9f3a29db34302905 to your computer and use it in GitHub Desktop.
A stripped down script that creates a single poly mesh. That is all.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import bpy | |
import bmesh | |
if __name__ == '__main__': | |
verts = [(-5, 0, 0), | |
(5, 0, 0), | |
(2, 5, 0),] | |
mesh = bpy.data.meshes.new("mymesh") | |
bm = bmesh.new() | |
for vert in verts: | |
bm.verts.new(vert) | |
bm.verts.ensure_lookup_table() | |
faces = [[0,1,2], ] | |
bm.faces.new([bm.verts[0], bm.verts[1], bm.verts[2]]) | |
bm.to_mesh(mesh) | |
mesh.update() | |
ob = bpy.data.objects.new("meshob", object_data=mesh) | |
scn = bpy.context.scene.objects.link(ob) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment