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 hide: The face's edit mode visibility state (hidden=1).
int index: The vertex's index within the mesh (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: The vertex texture "sticky" coordinates (x, y), Note: These are not seen in the UV editor and they are not a part of UV a UVLayer.

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)

hide

The face's edit mode visibility state (hidden=1).
Type:
int

index

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

no

The vertex's unit normal vector (x, y, z). Note: if vertex coordinates are changed, it may be necessary to use Mesh.calcNormals() to update the vertex normals. Note: Vertex normals can be set, but are not wrapped so modifying a normal vector will not effect the verts normal. The result is only visible when faces have the smooth option enabled. Example:
       # This won't work.
       for v in me.verts:
               v.no.x= 0
               v.no.y= 0
               v.no.z= 1
       # This will work
       no= Blender.Mathutils.Vector(0,0,1)
       for v in me.verts:
               v.no= no
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

The vertex texture "sticky" coordinates (x, y), Note: These are not seen in the UV editor and they are not a part of UV a UVLayer. Use face UV's for that. if present. Available for MVerts only. 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 May 10 20:31:59 2007 http://epydoc.sf.net