From 2424c57d12547c4361965ce5ec8be6eaa4ac212f Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Sat, 4 May 2019 23:29:11 +0300 Subject: [PATCH] Rename some variable to be a bit clearer --- blender/io_mspgl/mesh.py | 78 ++++++++++++++++++++-------------------- 1 file changed, 39 insertions(+), 39 deletions(-) diff --git a/blender/io_mspgl/mesh.py b/blender/io_mspgl/mesh.py index 077acc2e..44fbdcb0 100644 --- a/blender/io_mspgl/mesh.py +++ b/blender/io_mspgl/mesh.py @@ -6,19 +6,19 @@ def make_edge_key(i1, i2): 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: @@ -44,27 +44,27 @@ class Edge: 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: @@ -73,26 +73,26 @@ class Vertex: 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: @@ -160,12 +160,12 @@ class UvLayer: 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] @@ -507,13 +507,13 @@ class Mesh: 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 -- 2.45.2