Module NMesh :: Class NMFace
[frames | no frames]

Class NMFace


The NMFace object

This object holds mesh face data.

Example:
import Blender
from Blender import NMesh, Window

in_emode = Window.EditMode()
if in_emode: Window.EditMode(0)

me = NMesh.GetRaw("Mesh")
faces = me.faces

## Example for editmode faces selection:
selected_faces = []
for f in faces:
  if f.sel:
    selected_faces.append(f)
# ... unselect selected and select all the others:
for f in faces:
  f.sel = 1 - f.sel # 1 becomes 0, 0 becomes 1

## Example for uv textured faces selection:
selected_faces = []
SEL = NMesh.FaceFlags['SELECT']
# get selected faces:
for f in faces:
  if f.flag & SEL:
    selected_faces.append(f)
# ... unselect selected and select all the others:
for f in faces:
  if f.flag & SEL:
    f.flag &=~SEL # unselect these
  else: f.flag |= SEL # and select these

me.update()
if in_emode: Window.EditMode(1)
Blender.Redraw()

Notes:

Method Summary
  append(vertex)
Append a vertex to this face's vertex list.

Instance Variable Summary
  col: The list of vertex colors.
  flag: Bit vector specifying selection / visibility flags for uv textured faces (visible in Face Select mode, see NMesh.FaceFlags).
bool hide: The visibility state (1: hidden, 0: visible) of this NMesh's faces *in edit mode*.
  image: The Image used as a texture for this face.
  mat: Same as materialIndex below.
  materialIndex: The index of this face's material in its NMesh materials list.
  mode: The display mode (see Mesh.FaceModes)
  normal: (or just no) The normal vector for this face: [x,y,z].
bool sel: The selection state (1: selected, 0: unselected) of this NMesh's faces *in edit mode*.
  smooth: If non-zero, the vertex normals are averaged to make this face look smooth.
  transp: Transparency mode bit vector (see NMesh.FaceTranspModes).
  uv: List of per-face UV coordinates: [(u0, v0), (u1, v1), ...].
list v: The list of face vertices (up to 4).

Method Details

append(vertex)

Append a vertex to this face's vertex list.
Parameters:
vertex - An NMVert object.
           (type=NMVert)

Instance Variable Details

col

The list of vertex colors.

flag

Bit vector specifying selection / visibility flags for uv textured faces (visible in Face Select mode, see NMesh.FaceFlags).

hide

The visibility state (1: hidden, 0: visible) of this NMesh's faces *in edit mode*. This is not the same as the visibility state of the textured faces (see flag).
Type:
bool

image

The Image used as a texture for this face.

mat

Same as materialIndex below.

materialIndex

The index of this face's material in its NMesh materials list.

mode

The display mode (see Mesh.FaceModes)

normal

(or just no) The normal vector for this face: [x,y,z].

sel

The selection state (1: selected, 0: unselected) of this NMesh's faces *in edit mode*. This is not the same as the selection state of the textured faces (see flag).
Type:
bool

smooth

If non-zero, the vertex normals are averaged to make this face look smooth.

transp

Transparency mode bit vector (see NMesh.FaceTranspModes).

uv

List of per-face UV coordinates: [(u0, v0), (u1, v1), ...].

v

The list of face vertices (up to 4).
Type:
list

Generated by Epydoc 2.1 on Thu May 10 20:31:59 2007 http://epydoc.sf.net