All pastes #15631 Raw Edit

Miscellany

public python v1 · immutable
#15631 ·published 2005-06-23 10:37 UTC
rendered paste body
from Blender import *import mathimport sysxres = 10yres = 10xscale = 1yscale = 1mesh = NMesh.New()for y in range(yres):	for x in range(xres):		vert = NMesh.Vert(x,y,0)		mesh.verts.append(vert)print len(mesh.verts)for y in range(yres - 1):	for x in range(xres - 1):		print x,y		topleft = mesh.verts[y * xres + xres]		bottomleft = mesh.verts[(y + 1) * xres + xres]		topright = mesh.verts[y * xres + xres + 1]		bottomright = mesh.verts[(y + 1) * xres + xres + 1]		face1 = NMesh.Face([topleft, bottomleft, bottomright])		face2 = NMesh.Face([topleft, topright, bottomright])		mesh.faces.append(face1)		mesh.faces.append(face2)NMesh.PutRaw(mesh)