]> git.tdb.fi Git - libs/gl.git/commitdiff
Fix exporting compound objects with no materials
authorMikko Rasa <tdb@tdb.fi>
Tue, 31 Jul 2012 19:34:04 +0000 (22:34 +0300)
committerMikko Rasa <tdb@tdb.fi>
Tue, 31 Jul 2012 19:34:04 +0000 (22:34 +0300)
blender/io_mesh_mspgl/mesh.py

index ce4a7fd984f8fdffbcf7617c8c17830447ad6779..99fb2ee4dafe4f63fbf476440b229654db137de3 100644 (file)
@@ -67,7 +67,6 @@ class Face:
                self.vertices = mf.vertices[:]
                self.uvs = []
                self.flag = False
                self.vertices = mf.vertices[:]
                self.uvs = []
                self.flag = False
-               self.material = None
 
        def __getattr__(self, attr):
                return getattr(self._mface, attr)
 
        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
                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():
                        self.faces.append(f)
 
                for e in other.edges.values():