]> git.tdb.fi Git - libs/gl.git/blobdiff - blender/io_mspgl/export_object.py
Add a Loader for Scene, and a matching Blender exporter
[libs/gl.git] / blender / io_mspgl / export_object.py
index aad1c0876a40823bca2f1d4bc3ce5b7fe125ba41..d89afd05df667fb7c26d648a167bde38cc7ff8f8 100644 (file)
@@ -17,8 +17,11 @@ class ObjectExporter:
                self.external_tech = True
                self.shared_tech = True
 
-       def export(self, context, out_file):
-               obj = context.active_object
+       def export(self, context, out_file, objs=None):
+               if objs is None:
+                       obj = context.active_object
+               else:
+                       obj = objs[0]
 
                from .outfile import open_output
                out_file = open_output(out_file)
@@ -32,11 +35,11 @@ class ObjectExporter:
                        path, base = os.path.split(out_file.filename)
                        base, ext = os.path.splitext(base)
                        mesh_out = open_output(os.path.join(path, base+".mesh"))
-                       mesh = mesh_export.export(context, mesh_out)
+                       mesh = mesh_export.export(context, mesh_out, objs)
                        out_file.write("mesh", '"{}.mesh"'.format(base))
                else:
                        out_file.begin("mesh")
-                       mesh = mesh_export.export(context, out_file)
+                       mesh = mesh_export.export(context, out_file, objs)
                        out_file.end()
 
                if self.external_tech and obj.technique: