| Home | Trees | Index | Help |
|
|---|
| Module NMesh |
|
The Blender.NMesh submodule.
New:NMEdge) and nmesh methods (NMesh.addEdge,
NMesh.addEdgesData, etc.);
NMesh.update;
NMesh.transform;
GetNames.
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. |
NMEdge |
This object holds mesh edge data. |
NMesh |
This object gives access to mesh data in Blender. |
NMFace |
This object holds mesh face data. |
NMVert |
This object holds mesh vertex data. |
| Function Summary | |
|---|---|
| NMCol |
Get a new mesh rgba color. |
| NMFace |
Get a new face object. |
| list of strings |
Get a list with the names of all available meshes in Blender. |
| NMesh |
Get the mesh data object called name from Blender. |
| NMesh |
Get the raw mesh data object from the Object in Blender called name. |
Create a new mesh object. | |
| None or Object |
Put a BPython NMesh object as a mesh data object in Blender. |
| NMVert |
Get a new vertex object. |
| Variable Summary | |
|---|---|
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. |
| Function Details |
|---|
Col(col=[255, 255, 255, 255])Get a new mesh rgba color.
|
Face(vertexList=None)Get a new face object.
|
GetNames()Get a list with the names of all available meshes in Blender.
|
GetRaw(name=None)Get the mesh data object called name from Blender.
|
GetRawFromObject(name)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.
|
New(name='Mesh')Create a new mesh object.
|
PutRaw(nmesh, name=None, recalc_normals=1, store_edges=0)Put a BPython NMesh object as a mesh data object in Blender.
|
Vert(x=0, y=0, z=0)Get a new vertex object.
|
| Variable Details |
|---|
EdgeFlagsThe available edge flags.
|
| Home | Trees | Index | Help |
|
|---|
| Generated by Epydoc 2.1 on Mon Jun 13 15:31:22 2005 | http://epydoc.sf.net |