Home | Trees | Index | Help |
|
---|
Module Mesh :: Class MFace |
|
This object holds mesh face data.
Example:import Blender from Blender import Mesh, Window in_emode = Window.EditMode() if in_emode: Window.EditMode(0) me = Mesh.Get("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 = Mesh.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 if in_emode: Window.EditMode(1) Blender.Redraw()
Notes:
MFace.sel
and MFace.hide
attributes. For textured faces
(UV Face Select and Paint modes in Blender) use the MFace.flag
attribute. Check the example
above and note Window.EditMode
.
Method Summary | |
---|---|
MVert |
Iterator for MVert. |
Instance Variable Summary | |
---|---|
list of MCols | col : The face's vertex colors, if defined. |
flag : The face's texture mode flags; indicates the selection, active
, and visibility states of a textured face (see FaceFlags
for values). | |
int | hide : The face's edit mode visibility state (hidden=1). |
Image | image : The Image used as a texture for this face. |
int | index : The face's index within the mesh. |
int | mat : The face's index into the mesh's materials list. |
int | mode : The texture mode bitfield (see FaceModes ). |
vector | no : The face's normal vector (x, y, z). |
int | sel : The face's edit mode selection state (selected=1). |
int | smooth : If set, the vertex normals are averaged to make this face look
smooth. |
int | transp : Transparency mode. |
list of vectors (WRAPPED DATA) | uv : The face's UV coordinates. |
list of ints | uvSel : The face's UV coordinates seletion state; a 1 indicates the vertex is
selected. |
v : Same as verts . | |
list of MVerts | verts : The face's vertices. |
Method Details |
---|
__iter__()Iterator for MVert. It iterates over the MVerts of the face, returning v1, v2, v3 (and optionally v4);
|
Instance Variable Details |
---|
colThe face's vertex colors, if defined. Each vertex has its own color. Will throw an exception if the mesh does not have UV faces or vertex colors; useMesh.faceUV and Mesh.vertexColors to test. Note: if
a mesh has i{both} UV faces and vertex colors, the colors stored in the
UV faces will be used here.
|
flagThe face's texture mode flags; indicates the selection, active , and visibility states of a textured face (seeFaceFlags
for values). This is not the same as the selection or visibility states
of the faces in edit mode (see sel and hide ). To
set the active face, use the Mesh.activeFace attribute instead. Will
throw an exception if the mesh does not have UV faces; use Mesh.faceUV to test.
|
hideThe face's edit mode visibility state (hidden=1). This is not the same as the visibility state of the textured faces (seeflag ).
|
imageThe Image used as a texture for this face. Will throw an exception if the mesh does not have UV faces; useMesh.faceUV to test.
|
indexThe face's index within the mesh. Read-only.
|
matThe face's index into the mesh's materials list. It is in the range [0,15].
|
modeThe texture mode bitfield (seeFaceModes ). Will throw an exception if the
mesh does not have UV faces; use Mesh.faceUV to test.
|
noThe face's normal vector (x, y, z). Read-only.
|
selThe face's edit mode selection state (selected=1). This is not the same as the selection state of the textured faces (seeflag ).
|
smoothIf set, the vertex normals are averaged to make this face look smooth. (This is the same as choosing "Set Smooth" in the Editing Panel (F9) under "Link and Material" properties).
|
transpTransparency mode. It is one of the values inFaceTranspModes ). Will throw an exception
if the mesh does not have UV faces; use Mesh.faceUV to test.
|
uvThe face's UV coordinates. Each vertex has its own UV coordinate. Will throw an exception if the mesh does not have UV faces; useMesh.faceUV to test.
|
uvSelThe face's UV coordinates seletion state; a 1 indicates the vertex is selected. Each vertex has its own UV coordinate select state (this is not the same as the vertex's edit mode selection state). Will throw an exception if the mesh does not have UV faces; useMesh.faceUV to test.
|
vSame asverts . This attribute is only for
compatibility with NMesh scripts and will probably be deprecated in the
future.
|
vertsThe face's vertices. Each face has 3 or 4 vertices.
|
Home | Trees | Index | Help |
|
---|
Generated by Epydoc 2.1 on Thu Dec 22 22:38:13 2005 | http://epydoc.sf.net |