]> git.tdb.fi Git - libs/gl.git/blobdiff - blender/io_mspgl/export_object.py
Use an explicit material slot name in RenderPass
[libs/gl.git] / blender / io_mspgl / export_object.py
index 1fccfb79d1cf26116e506d561d25040bd1da36a4..2d2c25ed8013369c74661ba7b1f3c6b087193bec 100644 (file)
@@ -69,8 +69,7 @@ class ObjectExporter:
                                out_file.begin("level_of_detail", i)
                                objs = [l]
 
-                       same_mesh = (l.data.name==prev_mesh)
-                       if i==0 or not same_mesh:
+                       if i==0 or l.data.name!=prev_mesh:
                                mesh = self.export_object_mesh(context, out_file, l, objs, progress)
                                prev_mesh = l.data.name
 
@@ -142,7 +141,7 @@ class ObjectExporter:
                                        mat_name = material.name+".mat"
                                        mat_out = open_output(os.path.join(path, mat_name))
                                        self.export_material(material, mat_out)
-                                       out_file.write("material", '""', '"{}"'.format(mat_name))
+                                       out_file.write("material", '"surface"', '"{}"'.format(mat_name))
                                out_file.end()
                                out_file.end()
                        else: