From ef9cf91cd4638ed410a2573dd42ba25445e9bc80 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Sat, 4 May 2019 23:11:47 +0300 Subject: [PATCH] Make the edge map transient It's only actually used to associate edges with faces so it's simpler if it doesn't need to be maintained in other functions. --- blender/io_mspgl/mesh.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/blender/io_mspgl/mesh.py b/blender/io_mspgl/mesh.py index 42b1b1bd..a05d4537 100644 --- a/blender/io_mspgl/mesh.py +++ b/blender/io_mspgl/mesh.py @@ -170,7 +170,6 @@ class Mesh: self.vertices = [Vertex(v) for v in self.vertices] self.faces = [Face(f) for f in self.polygons] self.edges = [Edge(e) for e in self.edges] - self.edge_map = {e.key: e for e in self.edges} self.loops = self.loops[:] self.materials = self.materials[:] @@ -192,6 +191,7 @@ class Mesh: for v in self.vertices: v.groups = [VertexGroup(g) for g in v.groups] + edge_map = {e.key: e for e in self.edges} for f in self.faces: if len(f.vertices)>4: raise ValueError("Ngons are not supported") @@ -201,7 +201,7 @@ class Mesh: v.faces.append(f) for k in f.edge_keys: - e = self.edge_map[k] + e = edge_map[k] e.faces.append(f) f.edges.append(e) @@ -262,7 +262,6 @@ class Mesh: for e in self.edges[offset:]: e.index += offset e.key = make_edge_key(e.vertices[0].index, e.vertices[1].index) - self.edge_map[e.key] = e self.lines += other.lines @@ -421,14 +420,12 @@ class Mesh: ne.faces.append(f) e = ne else: - del self.edge_map[e.key] self.vertices[i].edges.remove(e) e.vertices[e.vertices.index(self.vertices[i])] = v v.edges.append(e) e.key = make_edge_key(e.vertices[0].index, e.vertices[1].index) - self.edge_map[e.key] = e for f in g: self.vertices[i].faces.remove(f) -- 2.45.2