From: Mikko Rasa Date: Tue, 31 Jul 2012 19:34:04 +0000 (+0300) Subject: Fix exporting compound objects with no materials X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=b621123e1b2118087223267598d887e8484aba40;p=libs%2Fgl.git Fix exporting compound objects with no materials --- diff --git a/blender/io_mesh_mspgl/mesh.py b/blender/io_mesh_mspgl/mesh.py index ce4a7fd9..99fb2ee4 100644 --- a/blender/io_mesh_mspgl/mesh.py +++ b/blender/io_mesh_mspgl/mesh.py @@ -67,7 +67,6 @@ class Face: self.vertices = mf.vertices[:] self.uvs = [] self.flag = False - self.material = None def __getattr__(self, attr): return getattr(self._mface, attr) @@ -178,7 +177,8 @@ class Mesh: offset = len(self.faces) for f in other.faces: f.index += offset - f.material = material_map[f.material_index] + if other.materials: + f.material_index = material_map[f.material_index] self.faces.append(f) for e in other.edges.values():