Home | Trees | Index | Help |
|
---|
Module NMesh :: Class NMesh |
|
Method Summary | |
---|---|
Add a new material to this NMesh's list of materials. | |
Add a named and empty vertex (deform) group to the object this nmesh is linked to. | |
Adds an array (a python list) of vertex points to a named vertex group associated with a mesh. | |
int |
Get the index of the active face. |
Get the max angle for auto smoothing. | |
int |
Get this mesh's mode flags. |
list |
Get list of selected faces. |
Get the mesh subdivision levels for realtime display and rendering. | |
list |
Get influences of bones in a specific vertex. |
Return a list of vertex indices associated with the passed group. | |
bool |
Get (and optionally set) if this NMesh has UV-mapped textured faces. |
bool |
Get (and optionally set) if this NMesh has vertex colours. |
bool |
Get (and optionally set) the "sticky" flag that controls if a mesh has per vertex UV coordinates. |
Insert a mesh key at the given frame. | |
bool |
Remove all mesh keys stored in this mesh. |
Remove a named vertex (deform) group from the object linked to this nmesh. | |
Remove a list of vertices from the given group. | |
Set the max angle for auto smoothing. | |
Set the mode flags for this mesh. | |
Set the mesh subdivision levels for realtime display and rendering. | |
Update the mesh in Blender. |
Class Variable Summary | |
---|---|
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. | |
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). |
Method Details |
---|
addMaterial(material)Add a new material to this NMesh's list of materials. This method is the slower but safer way to add materials, since it checks if the argument given is really a material, imposes a limit of 16 materials and only adds the material if it wasn't already in the list.
|
addVertGroup(group)Add a named and empty vertex (deform) group to the object this nmesh is linked to. If this nmesh was newly created or accessed with GetRaw, it must first be linked to an object (with object.link or NMesh.PutRaw) so the method knows which object to update. This is because vertex groups in Blender are stored in the object -- not in the mesh, which may be linked to more than one object. For this reason, it's better to use "mesh = object.getData()" than "mesh = NMesh.GetRaw(meshName)" to access an existing mesh.
|
assignVertsToGroup(group, vertList, weight, assignmode='replace')Adds an array (a python list) of vertex points to a named vertex group associated with a mesh. The vertex list is a list of vertex indices from the mesh. You should assign vertex points to groups only when the mesh has all its vertex points added to it and is already linked to an object. Example: The example here adds a new set of vertex indices to a sphere primitive:import Blender sphere = Blender.Object.Get('Sphere') mesh = sphere.getData() mesh.addVertGroup('firstGroup') vertList = [] for x in range(300): if x % 3 == 0: vertList.append(x) mesh.assignVertsToGroup('firstGroup', vertList, 0.5, 'add')
|
getActiveFace()Get the index of the active face.
|
getMaxSmoothAngle()Get the max angle for auto smoothing.
|
getMode()Get this mesh's mode flags.
|
getSelectedFaces(flag=None)Get list of selected faces.
|
getSubDivLevels()Get the mesh subdivision levels for realtime display and rendering.
|
getVertexInfluences(index)Get influences of bones in a specific vertex.
|
getVertsFromGroup(group, weightsFlag=0, vertList=None)Return a list of vertex indices associated with the passed group. This method can be used to test whether a vertex index is part of a group and if so, what its weight is. Example: Append this to the example fromassignVertsToGroup :
# ... print "Vertex indices from group %s :" % groupName print mesh.getVertsFromGroup('firstGroup') print "Again, with weights:" print mesh.getVertsFromGroup('firstGroup',1) print "Again, with weights and restricted to the given indices:" print mesh.getVertsFromGroup('firstGroup',1,[1,2,3,4,5,6])
|
hasFaceUV(flag=None)Get (and optionally set) if this NMesh has UV-mapped textured faces.
|
hasVertexColours(flag=None)Get (and optionally set) if this NMesh has vertex colours.
|
hasVertexUV(flag=None)Get (and optionally set) the "sticky" flag that controls if a mesh has per vertex UV coordinates.
|
insertKey(frame=None, type='relative')Insert a mesh key at the given frame. Remember toupdate the nmesh before doing this, or
changes in the vertices won't be updated in the Blender mesh.
|
removeAllKeys()Remove all mesh keys stored in this mesh.
|
removeVertGroup(group)Remove a named vertex (deform) group from the object linked to this nmesh. All vertices assigned to the group will be removed (just from the group, not deleted from the mesh), if any. If this nmesh was newly created, it must first be linked to an object (read the comment inaddVertGroup for more info).
|
removeVertsFromGroup(group, vertList=None)Remove a list of vertices from the given group. If this nmesh was newly created, it must first be linked to an object (checkaddVertGroup ).
|
setMaxSmoothAngle(angle)Set the max angle for auto smoothing.
|
setMode(m=None, m1=None, m2=None, m3=None)Set the mode flags for this mesh. Given mode strings turn the mode "on". Modes not passed in are turned "off", so setMode() (without arguments) unsets all mode flags.
|
setSubDivLevels(subdiv)Set the mesh subdivision levels for realtime display and rendering.
|
update(recalc_normals=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 object if this NMesh wasn't linked to one, yet.
|
Class Variable Details |
---|
facesThe list of NMesh faces (NMFaces). |
materialsThe list of materials used by this NMesh. |
maxSmoothAngleThe max angle for auto smoothing. SeesetMode .
|
modeThe mode flags for this mesh. SeesetMode .
|
nameThe NMesh name. It's common to use this field to store extra data about the mesh (to be exported to another program, for example). |
subDivLevelsThe [display, rendering] subdivision levels in [1, 6]. |
usersThe number of Objects using (linked to) this mesh. |
vertsThe list of NMesh vertices (NMVerts). |
Home | Trees | Index | Help |
|
---|
Generated by Epydoc 2.0 on Tue Nov 11 20:06:11 2003 | http://epydoc.sf.net |