Module Mesh :: Class MVert
[frames | no frames]

Class MVert


The MVert object

This object holds mesh vertex data.

Warning: There are two kinds of UV texture coordinates in Blender: per vertex ("sticky") and per face vertex (UV in MFace). In the first, there's only one UV pair of coordinates for each vertex in the mesh. In the second, for each face it belongs to, a vertex can have different UV coordinates. This makes the per face option more flexible, since two adjacent faces won't have to be mapped to a continuous region in an image: each face can be independently mapped to any part of its texture.

Method Summary
PVert __init__(coord)
Create a new PVert object.

Instance Variable Summary
vector (WRAPPED DATA) co: The vertex coordinates (x, y, z).
int index: (MVerts only).
vector no: The vertex's unit normal vector (x, y, z).
int sel: The vertex's selection state (selected=1).
vector (WRAPPED DATA) uvco: (MVerts only).

Method Details

__init__(coord)
(Constructor)

Create a new PVert object.
Parameters:
coord - the coordinate values for the new vertex
           (type=three floats or a Vector object)
Returns:
a new PVert object
           (type=PVert)

Note:

PVert-type objects are designed to be used for creating and modifying a mesh's vertex list, but since they do not "wrap" any Blender data there are some differences. The index and uvco attributes are not defined for PVerts, and the no attribute contains valid data only if the PVert was created from an MVert (using a slice operation on the mesh's vertex list.) PVerts also cannot be used as an argument to any method which expects data wrapping a Blender mesh, such as MVertSeq.delete().

Example:
 v = Blender.Mesh.MVert(1,0,0)
 v = Blender.Mesh.MVert(Blender.Mathutils.Vector([1,0,0]))

 m = Blender.Mesh.Get('Mesh')
 vlist = m.verts[:]   # slice operation also returns PVerts


Instance Variable Details

co

The vertex coordinates (x, y, z).
Type:
vector (WRAPPED DATA)

index

(MVerts only). The vertex's index within the mesh. Read-only.
Type:
int

no

The vertex's unit normal vector (x, y, z). Read-only. Note: if vertex coordinates are changed, it may be necessary to use Mesh.calcNormals() to update the vertex normals.
Type:
vector

sel

The vertex's selection state (selected=1). Note: a Mesh will return the selection state of the mesh when EditMode was last exited. A Python script operating in EditMode must exit EditMode before getting the current selection state of the mesh.
Type:
int

uvco

(MVerts only). The vertex texture "sticky" coordinates (x, y), if present. Use Mesh.vertexUV to test for presence before trying to access; otherwise an exception will may be thrown. (Sticky coordinates can be set when the object is in the Edit mode; from the Editing Panel (F9), look under the "Mesh" properties for the "Sticky" button).
Type:
vector (WRAPPED DATA)

Generated by Epydoc 2.1 on Thu Dec 22 22:38:12 2005 http://epydoc.sf.net