Module Mesh :: Class MFaceSeq
[frames | no frames]

Class MFaceSeq


The MFaceSeq object

This object provides sequence and iterator access to the mesh's faces.
Method Summary
  delete(deledges, faces)
Deletes one or more faces (and optionally the edges associated with the face(s)) from the mesh.
  extend(vertseq)
Add zero or more faces and edges to the mesh.
list of ints selected()
Get selected faces.

Method Details

delete(deledges, faces)

Deletes one or more faces (and optionally the edges associated with the face(s)) from the mesh.
Parameters:
deledges - controls whether just the faces (deledges=0) or the faces and edges (deledges=1) are deleted. These correspond to the "Only Faces" and "Edges & Faces" options in the Edit Mode pop-up menu
           (type=int)
faces - a sequence (list or tuple) containing one or more of:
  • an MEdge belonging to the mesh
  • a integer, specifying an index into the mesh's face list

           (type=multiple ints or MFaces)

extend(vertseq)

Add zero or more faces and edges to the mesh. Faces which already exist in the mesh, or faces which contain the same vertex multiple times are ignored. Sequences of two vertices are accepted, but no face will be created.

Example:
 import Blender
 from Blender import Mesh

 me = Mesh.Get("Plane")          # get the mesh data called "Plane"
 v = me.verts                    # get vertices
 if len(v) >= 6:                 # if there are enough vertices...
   me.faces.extend(v[1],v[2],v[3]) #   add a single edge
   l=[(v[0],v[1]),[0,2,4,5]]
   me.faces.extend(l)            #   add another face
Parameters:
vertseq - either two to four ints or MVerts, or sequence (list or tuple) of sequences each containing two to four ints or MVerts.
           (type=sequence(s) of MVerts)

selected()

Get selected faces.
Returns:
a list of the indices for all faces selected in edit mode.
           (type=list of ints)

Generated by Epydoc 2.1 on Thu Jul 13 16:50:05 2006 http://epydoc.sf.net