Method Summary |
NMEdge
|
addEdge (v1,
v2)
Create an edge between two vertices. |
list of NMEdge
|
addFace (face)
Add a face to face list and add to edge list (if edge data exists)
necessary edges. |
|
addMaterial (material)
Add a new material to this NMesh's list of materials. |
|
addVertGroup (group)
Add a named and empty vertex (deform) group to the object this nmesh
is linked to. |
|
assignVertsToGroup (group,
vertList,
weight,
assignmode)
Adds an array (a python list) of vertex points to a named vertex group
associated with a mesh. |
NMEdge
|
findEdge (v1,
v2)
Try to find an edge between two vertices. |
int
|
getActiveFace ()
Get the index of the active face. |
Key.Key object or None
|
getKey ()
Get the Key object representing the Vertex Keys (absolute or relative)
assigned to this mesh. |
list of materials
|
getMaterials (what)
Get this NMesh's list of materials. |
|
getMaxSmoothAngle ()
Get the max angle for auto smoothing. |
int
|
getMode ()
Get this mesh's mode flags. |
list
|
getSelectedFaces (flag)
Get list of selected faces. |
|
getSubDivLevels ()
Get the mesh subdivision levels for realtime display and
rendering. |
list of lists
|
getVertexInfluences (index)
Get influences of bones in a specific vertex. |
list of strings
|
getVertGroupNames ()
Return a list of all vertex group names. |
|
getVertsFromGroup (group,
weightsFlag,
vertList)
Return a list of vertex indices associated with the passed group. |
bool
|
hasFaceUV (flag)
Get (and optionally set) if this NMesh has UV-mapped textured
faces. |
bool
|
hasVertexColours (flag)
Get (and optionally set) if this NMesh has vertex colors. |
bool
|
hasVertexUV (flag)
Get (and optionally set) the "sticky" flag that controls if
a mesh has per vertex UV coordinates. |
|
insertKey (frame,
type)
Insert a mesh key at the given frame. |
bool
|
removeAllKeys ()
Remove all mesh keys stored in this mesh. |
|
removeEdge (v1,
v2)
Remove an edge between two vertices. |
|
removeFace (face)
Remove a face for face list and remove edges no more used by any other
face (if edge data exists). |
|
removeVertGroup (group)
Remove a named vertex (deform) group from the object linked to this
nmesh. |
|
removeVertsFromGroup (group,
vertList)
Remove a list of vertices from the given group. |
|
renameVertGroup (groupName,
newName)
Renames a vertex group. |
|
setMaterials (matlist)
Set this NMesh's list of materials. |
|
setMaxSmoothAngle (angle)
Set the max angle for auto smoothing. |
|
setMode (m,
m1,
m2)
Set the mode flags for this mesh. |
|
setSubDivLevels (subdiv)
Set the mesh subdivision levels for realtime display and
rendering. |
|
transform (matrix,
recalc_normals)
Transforms the mesh by the specified 4x4 matrix, as returned by Object.Object.getMatrix , though this will
work with any invertible 4x4 matrix type. |
|
update (recalc_normals,
store_edges,
vertex_shade)
Update the mesh in Blender. |
Instance Variable Summary |
|
edges : A list of NMEdge edges. |
|
faces : The list of NMesh faces (NMFaces). |
|
materials : The list of materials used by this NMesh. |
|
maxSmoothAngle : The max angle for auto smoothing. |
|
mode : The mode flags for this mesh. |
|
name : The NMesh name. |
IDGroup |
properties : Returns an IDGroup reference to this object's ID
Properties. |
|
subDivLevels : The [display, rendering] subdivision levels in [1, 6]. |
|
users : The number of Objects using (linked to) this mesh. |
|
verts : The list of NMesh vertices (NMVerts). |
update(recalc_normals=0,
store_edges=0,
vertex_shade=0)
Update the mesh in Blender. The changes made are put back to the
mesh in Blender, if available, or put in a newly created mesh if this
NMesh wasn't already linked to one.
-
- Parameters:
recalc_normals -
if nonzero the vertex normals are recalculated.
(type=int (bool))
store_edges -
deprecated, edges are always stored now.
(type=int (bool))
vertex_shade -
if nonzero vertices are colored based on the current lighting
setup, like when there are no vertex colors and no textured faces
and a user enters Vertex Paint Mode in Blender (only lamps in
visible layers account). To use this functionality, be out of
edit mode or else an error will be returned.
(type=int (bool))
Warnings:
- edit mesh and normal mesh are two different structures in Blender,
synchronized upon leaving or entering edit mode. Always remember to leave
edit mode (
Window.EditMode ) before calling this update
method, or your changes will be lost. Even better: for the same reason
programmers should leave EditMode before getting a mesh, or
changes made to the editmesh in Blender may not be visible to your script
(check the example at the top of NMesh module doc).
- unlike the
PutRaw function, this method doesn't check
validity of vertex, face and material lists, because it is meant to be as
fast as possible (and already performs many tasks). So programmers should
make sure they only feed proper data to the nmesh -- a good general
recommendation, of course. It's also trivial to write code to check all
data before updating, for example by comparing each item's type with the
actual Types ,
if you need to.
Notes:
- this method also redraws the 3d view and -- if 'vertex_shade' is
nonzero -- the edit buttons window.
- if your mesh disappears after it's updated, try
Object.Object.makeDisplayList . 'Subsurf'
meshes (see getMode , setMode ) need their display lists updated,
too.
|