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

Class MEdge


The MEdge object

This object holds mesh edge data.
Method Summary
MVert __iter__()
Iterator for MEdge.

Instance Variable Summary
int crease: The crease value of the edge.
int flag: The bitfield describing edge properties.
int index: The edge's index within the mesh.
float length: The length of the edge, same as (ed.v1.co-ed.v2.co).length where "ed" is an MEdge.
int sel: The edge's edit mode selection state (selected=1).
MVert v1: The first vertex of the edge.
MVert v2: The second vertex of the edge.

Method Details

__iter__()

Iterator for MEdge. It iterates over the MVerts of the edge, returning v1 then v2.
Returns:
one of the edge's vertices
           (type=MVert)

Instance Variable Details

crease

The crease value of the edge. It is in the range [0,255].
Type:
int

flag

The bitfield describing edge properties. See EdgeFlags. Example:
# This script counts fgon and non fgon edges
from Blender import Scene, Mesh
scn= Scene.GetCurrent() # Current scene, important to be scene aware
ob= scn.getActiveObject() # last selected object
me= ob.getData(mesh=1) # thin wrapper doesn't copy mesh data like nmesh

total_fgon_eds= total_nor_eds= 0

# Look through the edges and find any fgon edges, then print the findings to the console
for ed in me.edges: # all meshes have edge data now
   if ed.flag & Mesh.EdgeFlags.FGON:
           total_fgon_eds+=1
   else:
           total_nor_eds+=1

print 'Blender has', total_fgon_eds, 'fgon edges and', total_nor_eds, 'non fgon edges'
Type:
int

index

The edge's index within the mesh. Read-only.
Type:
int

length

The length of the edge, same as (ed.v1.co-ed.v2.co).length where "ed" is an MEdge.
Type:
float

sel

The edge's edit mode selection state (selected=1). Note: changing the select state of an edge changes the select state of the edge's vertices.
Type:
int

v1

The first vertex of the edge.
Type:
MVert

v2

The second vertex of the edge.
Type:
MVert

Generated by Epydoc 2.1 on Thu Jul 13 16:50:05 2006 http://epydoc.sf.net