Home | Trees | Indices | Help |
|
---|
|
Instance Methods | |||
NMEdge |
|
||
NMEdge |
|
||
|
|||
list of NMEdge |
|
||
|
|||
|
|||
list of materials |
|
||
|
|||
bool |
|
||
bool |
|
||
bool |
|
||
int |
|
||
list |
|
||
list of lists |
|
||
Key.Key object or None |
|
||
|
|||
bool |
|
||
|
|||
|
|||
int |
|
||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
list of strings |
|
||
|
|||
|
|||
|
|||
|
Class Variables | |
key The Key.Key object attached to this mesh, if any. |
Instance Variables | |
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). |
Method Details |
Note: In Blender only zero or one edge can link two vertices. |
|
|
|
|
|
Notes:
|
Note: Object.colbits needs to be set correctly for each object in order for these materials to be used instead of the object's materials. |
Warning: If a mesh has both vertex colors and textured faces, this function will return False. This is due to the way Blender deals internally with the vertex colors array (if there are textured faces, it is copied to the textured face structure and the original array is freed/deleted). If you want to know if a mesh has both textured faces and vertex colors, set *in Blender* the "VCol Paint" flag for each material that covers an area that was also vertex painted and then check in your Python script if that material flag is set. Of course also tell others who use your script to do the same. The "VCol Paint" material mode flag is the way to tell Blender itself to render with vertex colors, too, so it's a natural solution. |
|
|
|
Warning: this method exists to speed up retrieving of selected faces from the actual mesh in Blender. So, if you make changes to the nmesh, you need to update it before using this method. |
|
Warning: This and removeAllKeys were included in this release only to make accessing vertex keys possible, but may not be a proper solution and may be substituted by something better later. For example, it seems that 'frame' should be kept in the range [1, 100] (the curves can be manually tweaked in the Ipo Curve Editor window in Blender itself later). |
Warning: Currently the mesh keys from meshes that are grabbed with NMesh.GetRaw() or .GetRawFromObject() are preserved, so if you want to clear them or don't want them at all, remember to call this method. Of course NMeshes created with NMesh.New() don't have mesh keys until you add them. |
Warnings:
|
Transforms the mesh by the specified 4x4 matrix, as returned by Object.Object.getMatrix, though this will work with any invertible 4x4 matrix type. Ideal usage for this is exporting to an external file where global vertex locations are required for each object. Sometimes external renderers or file formats do not use vertex normals. In this case, you can skip transforming the vertex normals by leaving the optional parameter recalc_normals as False or 0 ( the default value ). Example:# 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
Warning: if you call this method and later update the mesh, the new vertex positions will be passed back to Blender, but the object matrix of each object linked to this mesh won't be automatically updated. You need to set the object transformations (rotation, translation and scaling) to identities, then, or the mesh data will be changed ("transformed twice"). |
|
|
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.
|
|
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')
|
|
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 from assignVertsToGroup:# ... 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])
|
|
|
|
|
|
|
Instance Variable Details |
materialsThe list of materials used by this NMesh. See getMaterials for important details. |
maxSmoothAngleThe max angle for auto smoothing. See setMode. |
modeThe mode flags for this mesh. See setMode. |
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). |
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0beta1 on Mon May 19 15:32:20 2008 | http://epydoc.sourceforge.net |