From ab60e3a21afcfc970004512044ae32fac5c2112e Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Sun, 12 May 2019 08:36:17 +0300 Subject: [PATCH] Some cleanups to exporter code --- blender/io_mspgl/export_mesh.py | 1 - blender/io_mspgl/mesh.py | 17 +++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/blender/io_mspgl/export_mesh.py b/blender/io_mspgl/export_mesh.py index 771f825e..3e146cad 100644 --- a/blender/io_mspgl/export_mesh.py +++ b/blender/io_mspgl/export_mesh.py @@ -7,7 +7,6 @@ class MeshExporter: self.show_progress = True self.use_strips = True self.use_degen_tris = False - self.material_tex = False def join_strips(self, strips): big_strip = [] diff --git a/blender/io_mspgl/mesh.py b/blender/io_mspgl/mesh.py index c3767bd9..f3579362 100644 --- a/blender/io_mspgl/mesh.py +++ b/blender/io_mspgl/mesh.py @@ -114,7 +114,7 @@ class Face: if flags[i] and not flags[(i+l-1)%l]: return self.vertices[i:]+self.vertices[:i] - def get_edge(self, v1, v2): + def get_edge(self, v1, v2): key = make_edge_key(v1.index, v2.index) for e in self.edges: if e.key==key: @@ -143,6 +143,7 @@ class UvLayer: if type(arg)==str: self._layer = None self.name = arg + self.uvs = [] else: self._layer = arg self.name = arg.name @@ -172,20 +173,20 @@ class Mesh: self.vertex_groups = mesh.vertex_groups # Clone basic data - self.vertices = [Vertex(v) for v in self.vertices] + self.vertices = [Vertex(v) for v in mesh.vertices] for v in self.vertices: v.groups = [VertexGroup(g) for g in v.groups] - self.faces = [Face(f) for f in self.polygons] - self.edges = [Edge(e) for e in self.edges] - self.loops = self.loops[:] - self.materials = self.materials[:] + self.faces = [Face(f) for f in mesh.polygons] + self.edges = [Edge(e) for e in mesh.edges] + self.loops = mesh.loops[:] + self.materials = mesh.materials[:] # Clone only the desired UV layers - if self.use_uv=='NONE' or not self.uv_layers: + if self.use_uv=='NONE' or not mesh.uv_layers: self.uv_layers = [] else: - self.uv_layers = [UvLayer(u) for u in self.uv_layers] + self.uv_layers = [UvLayer(u) for u in mesh.uv_layers] self.uv_layers = sorted([u for u in self.uv_layers if not u.hidden], key=(lambda u: (u.unit or 1000, u.name))) if self.use_uv=='UNIT0': -- 2.45.2