return (min(i1, i2), max(i1, i2))
class Edge:
- def __init__(self, me):
- if me.__class__==Edge:
- self._medge = me._medge
- self.vertices = me.vertices[:]
- self.smooth = me.smooth
+ def __init__(self, edge):
+ if edge.__class__==Edge:
+ self._edge = edge._edge
+ self.vertices = edge.vertices[:]
+ self.smooth = edge.smooth
else:
- self._medge = me
+ self._edge = edge
self.smooth = False
- self.key = me.key
+ self.key = edge.key
self.faces = []
def __getattr__(self, attr):
- return getattr(self._medge, attr)
+ return getattr(self._edge, attr)
def check_smooth(self, limit):
if len(self.faces)!=2:
class Vertex:
- def __init__(self, mv):
- if mv.__class__==Vertex:
- self._mvert = mv._mvert
- self.uvs = mv.uvs[:]
- self.tan = mv.tan
- self.bino = mv.bino
+ def __init__(self, vertex):
+ if vertex.__class__==Vertex:
+ self._vertex = vertex._vertex
+ self.uvs = vertex.uvs[:]
+ self.tan = vertex.tan
+ self.bino = vertex.bino
else:
- self._mvert = mv
+ self._vertex = vertex
self.uvs = []
self.tan = None
self.bino = None
- self.index = mv.index
- self.co = mv.co
- self.normal = mv.normal
+ self.index = vertex.index
+ self.co = vertex.co
+ self.normal = vertex.normal
self.flag = False
self.edges = []
self.faces = []
- self.groups = mv.groups[:]
+ self.groups = vertex.groups[:]
def __getattr__(self, attr):
- return getattr(self._mvert, attr)
+ return getattr(self._vertex, attr)
def __cmp__(self, other):
if other is None:
class VertexGroup:
- def __init__(self, base):
- self._base = base
- self.group = base.group
- self.weight = base.weight
+ def __init__(self, group):
+ self._group = group
+ self.group = group.group
+ self.weight = group.weight
def __getattr__(self, attr):
- return getattr(self._mvert, attr)
+ return getattr(self._group, attr)
class Face:
- def __init__(self, mf):
- self._mface = mf
- self.index = mf.index
+ def __init__(self, face):
+ self._face = face
+ self.index = face.index
self.edges = []
- self.vertices = mf.vertices[:]
+ self.vertices = face.vertices[:]
self.uvs = []
self.flag = False
def __getattr__(self, attr):
- return getattr(self._mface, attr)
+ return getattr(self._face, attr)
def __cmp__(self, other):
if other is None:
class Mesh:
- def __init__(self, m):
- self._mesh = m
+ def __init__(self, mesh):
+ self._mesh = mesh
- self.winding_test = m.winding_test
- self.tbn_vecs = m.tbn_vecs
- self.vertex_groups = m.vertex_groups
+ self.winding_test = mesh.winding_test
+ self.tbn_vecs = mesh.tbn_vecs
+ self.vertex_groups = mesh.vertex_groups
self.vertices = [Vertex(v) for v in self.vertices]
self.faces = [Face(f) for f in self.polygons]
def drop_references(self):
for v in self.vertices:
- v._mvert = None
+ v._vertex = None
for g in v.groups:
- g._base = None
+ g._group = None
for e in self.edges:
- e._medge = None
+ e._edge = None
for f in self.faces:
- f._mface = None
+ f._face = None
for u in self.uv_layers:
u._layer = None
self._mesh = None