i’d like to create a surface plane through python. so basicaly 4 ‘verts’ and a face inbetween. the following code is making a nurbs curve, but i need a nurbs surface (different thing). after a afternoon experimenting i keep getting curves, without faces, and i can’t make the faces manually either. any thoughts?
import bpy
from mathutils import Vector
coords = [(-.5,-.5,0,0),(-.5,.5,0,0),(.5,.5,0,0),(.5,-.5,0,0)]
surfdata = bpy.data.curves.new(name = 'SurfPlane',type = 'SURFACE')
objectdata = bpy.data.objects.new('SurfPlane', surfdata)
objectdata.location = (0,0,0)
bpy.context.scene.objects.link(objectdata)
SurfacePlane = surfdata.splines.new('NURBS')
SurfacePlane.points.add(len(coords)-1)
for num in range(len(coords)):
SurfacePlane.points[num].co=(coords[num])
the code is mainly from zeffii’s blog, for creating a curve.
and another question: what is the curve/nurbs equivelant of:
tuple(bpy.data.meshes[‘Plane’].vertices[1].co)?