Home | Trees | Indices | Help |
|
---|
|
The Blender.NMesh submodule.
Deprecated: This module is now maintained but not actively developed.
Access to data such as properties, library, UVLayers and ColorLayers is not available further more, a mesh modified with NMesh will destroy inactive UV and Color layers so writing tools that use NMesh is discouraged.
Use Mesh instead.
This module provides access to Mesh Data objects in Blender.
Example:
import Blender from Blender import NMesh, Material, Window editmode = Window.EditMode() # are we in edit mode? If so ... if editmode: Window.EditMode(0) # leave edit mode before getting the mesh me = NMesh.GetRaw("Plane") # get the mesh data called "Plane" if not me.materials: # if there are no materials ... newmat = Material.New() # create one ... me.materials.append(newmat) # and append it to the mesh's list of mats print me.materials # print the list of materials mat = me.materials[0] # grab the first material in the list mat.R = 1.0 # redefine its red component for v in me.verts: # loop the list of vertices v.co[0] *= 2.5 # multiply the coordinates v.co[1] *= 5.0 v.co[2] *= 2.5 me.update() # update the real mesh in Blender if editmode: Window.EditMode(1) # optional, just being nice
Classes | |
NMCol This object is a list of ints: [r, g, b, a] representing an rgba color. |
|
NMVert This object holds mesh vertex data. |
|
NMEdge This object holds mesh edge data. |
|
NMFace This object holds mesh face data. |
|
NMesh This object gives access to mesh data in Blender. |
Functions | |||
NMCol |
|
||
NMVert |
|
||
NMFace |
|
||
|
|||
NMesh |
|
||
list of strings |
|
||
NMesh |
|
||
None or Object |
|
Variables | |
EdgeFlags The available edge flags. |
|
readonly dictionary |
FaceFlags The available *texture face* (uv face select mode) selection flags. |
readonly dictionary |
FaceModes The available *texture face* modes. |
readonly dictionary |
FaceTranspModes The available face transparency modes. |
readonly dictionary |
Modes The available mesh modes. |
__package__ = None
|
Function Details |
Get a new mesh rgba color.
|
Get a new vertex object.
|
Get a new face object.
|
Create a new mesh object.
|
Get the mesh data object called name from Blender.
|
Get a list with the names of all available meshes in Blender.
Note: to get actual mesh data, pass a mesh name to GetRaw. |
Get the raw mesh data object from the Object in Blender called name. Note: The mesh coordinates are in local space, not the world space of its Object. For world space vertex coordinates, each vertex location must be multiplied by the object's 4x4 matrix. This function support all the geometry based objects: Mesh, Text, Surface, Curve, Meta.
Notes:
|
Put a BPython NMesh object as a mesh data object in Blender.
Note: if there is already a mesh with the given 'name', its contents are freed and the new data is put in it. Also, if this mesh is not linked to any object, a new object for it is created. Reminder: in Blender an object is composed of the base object and linked object data (mesh, metaball, camera, etc. etc). |
Variables Details |
EdgeFlagsThe available edge flags.
|
FaceFlagsThe available *texture face* (uv face select mode) selection flags. Note: these refer to TexFace faces, available if nmesh.hasFaceUV() returns true.
|
FaceModesThe available *texture face* modes. Note: these are only meaningful if nmesh.hasFaceUV() returns true, since in Blender this info is stored at the TexFace (TexFace button in Edit Mesh buttons) structure.
|
FaceTranspModesThe available face transparency modes. Note: these are enumerated values (enums), they can't be combined (ANDed, ORed, etc) like a bit vector.
|
ModesThe available mesh modes.
|
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0 on Mon Aug 31 23:12:22 2009 | http://epydoc.sourceforge.net |