Module Mesh :: Class MEdge

Class MEdge

source code

The MEdge object

This object holds mesh edge data.

Instance Methods
MVert
__iter__()
Iterator for MEdge.
source code
Instance Variables
int crease
The crease value of the edge.
int flag
The bitfield describing edge properties.
int index
The edge's index within the mesh.
tuple key
The edge's vert indices in an ordered tuple, which can be used as a dictionary key.
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__()

source code 
Iterator for MEdge. It iterates over the MVerts of the edge, returning v1 then v2.
Returns: MVert
one of the edge's vertices

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.objects.active # 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

key

The edge's vert indices in an ordered tuple, which can be used as a dictionary key. Read-only. This is the same as (min(ed.v1.index, ed.v2.index), max(ed.v1.index, ed.v2.index))
Type:
tuple

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