Home | Trees | Index | Help |
|
---|
Module NMesh :: Class NMFace |
|
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:
NMFace.sel
and NMFace.hide
vars. For textured faces (Face
Select mode in Blender) use the old NMFace.flag
bitflag. Also check the example
above and note Window.EditMode
.
Method Summary | |
---|---|
Append a vertex to this face's vertex list. |
Class Variable Summary | |
---|---|
col : The list of vertex colours. | |
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.
|
Class Variable Details |
---|
colThe list of vertex colours. |
flagBit vector specifying selection / visibility flags for uv textured faces (visible in Face Select mode, seeNMesh.FaceFlags ).
|
hideThe 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 (seeNMesh.NMFace.flag ).
|
imageThe Image used as a texture for this face. |
matSame as materialIndex below. |
materialIndexThe index of this face's material in its NMesh materials list. |
modeThe display mode (seeMesh.FaceModes )
|
normal(or just no) The normal vector for this face: [x,y,z]. |
selThe 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 (seeNMesh.NMFace.flag ).
|
smoothIf non-zero, the vertex normals are averaged to make this face look smooth. |
transpTransparency mode bit vector (seeNMesh.FaceTranspModes ).
|
uvList of per-face UV coordinates: [(u0, v0), (u1, v1), ...]. |
vThe list of face vertices (up to 4).
|
Home | Trees | Index | Help |
|
---|
Generated by Epydoc 2.1 on Mon Jun 13 15:31:23 2005 | http://epydoc.sf.net |