Home | Trees | Index | Help |
|
---|
Module NMesh :: Class NMesh |
|
Method Summary | |
---|---|
NMEdge |
Create an edge between two vertices. |
If edge data does not exist for the mesh (ie edges ==None), then create them. | |
list of NMEdge |
Add a face to face list and add to edge list (if edge data exists) necessary edges. |
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. | |
NMEdge |
Try to find an edge between two vertices. |
int |
Get the index of the active face. |
list of materials |
Get this NMesh's list of materials. |
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 of lists |
Get influences of bones in a specific vertex. |
list of strings |
Return a list of all vertex group names. |
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 an edge between two vertices. | |
Remove a face for face list and remove edges no more used by any other face (if edge data exists). | |
Remove a named vertex (deform) group from the object linked to this nmesh. | |
Remove a list of vertices from the given group. | |
Renames a vertex group. | |
Set this NMesh's list of materials. | |
Set the max angle for auto smoothing. | |
Set the mode flags for this mesh. | |
Set the mesh subdivision levels for realtime display and rendering. | |
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 the mesh in Blender. |
Class Variable Summary | |
---|---|
edges : None if mesh has no edge data, else 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. | |
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 |
---|
addEdge(v1, v2)Create an edge between two vertices. If an edge already exists between those vertices, it is returned. Created edge is automatically added to edges list. You can only call this method if mesh has edge data.
|
addEdgesData()If edge data does not exist for the mesh (ieedges ==None), then create them.
|
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. 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')
|
findEdge(v1, v2)Try to find an edge between two vertices. If no edge exists between v1 and v2, None is returned. You can only call this method if mesh has edge data.
|
getActiveFace()Get the index of the active face.
|
getMaterials(what=-1)Get this NMesh's list of materials.
|
getMaxSmoothAngle()Get the max angle for auto smoothing. Note: This will only affect smoothing generated at render time. Smoothing can also be set per face which is visible in Blenders 3D View.
|
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.
|
getVertGroupNames()Return a list of all vertex group names.
|
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.
|
removeEdge(v1, v2)Remove an edge between two vertices. All faces using this edge are removed from faces list. You can only call this method if mesh has edge data.
|
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. 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 ).
|
renameVertGroup(groupName, newName)Renames a vertex group.
|
setMaterials(matlist)Set this NMesh's list of materials. This method checks the consistency of the passed list: must only have materials or None's and can't contain more than 16 entries.
|
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.
|
transform(matrix, recalc_normals=False)Transforms the mesh by the specified 4x4 matrix, as returned by # This script outputs deformed meshes worldspace vertex locations # for a selected object import Blender from Blender import NMesh, Object ob = Object.GetSelected()[0] # Get the first selected object me = NMesh.GetRawFromObject(ob.name) # Get the objects deformed mesh data me.transform(ob.matrix) for v in me.verts: print 'worldspace vert', v.co
|
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.
|
Class Variable Details |
---|
edgesNone if mesh has no edge data, else a list ofNMEdge
edges. Use addEdgesData to create edge data if it do
not exist.
|
facesThe list of NMesh faces (NMFaces). |
materialsThe list of materials used by this NMesh. SeeNMesh.getMaterials for important
details.
|
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.1 on Mon Jun 13 15:31:22 2005 | http://epydoc.sf.net |