]> git.tdb.fi Git - libs/gl.git/blobdiff - blender/io_mspgl/export_mesh.py
Make resource handling in the Blender exporter more flexible
[libs/gl.git] / blender / io_mspgl / export_mesh.py
index bb116bda9133f3f8192e5ebfa0f42bc10ad046f1..7b8fd771cd0ceab2c926a1be0db9cc3207745ab1 100644 (file)
@@ -32,10 +32,10 @@ class MeshExporter:
 
                progress = Progress(self.show_progress and context)
                progress.push_task("", 0.0, 0.95)
-               statements = self.export_mesh(context, obj, progress)
+               resource = self.export_mesh(context, obj, progress)
 
                with open(out_fn, "w") as out_file:
-                       for s in statements:
+                       for s in resource.statements:
                                s.write_to_file(out_file)
 
        def export_mesh(self, context, mesh_or_obj, progress):
@@ -48,9 +48,9 @@ class MeshExporter:
                        mesh = create_mesh_from_object(context, mesh_or_obj, progress)
                        progress.pop_task()
 
-               from .datafile import Statement, Token
-
-               statements = []
+               from .datafile import Resource, Statement, Token
+               resource = Resource(mesh.name+".mesh")
+               statements = resource.statements
 
                st = Statement("vertices", Token("NORMAL3"))
                if mesh.uv_layers:
@@ -129,4 +129,4 @@ class MeshExporter:
 
                progress.set_progress(1.0)
 
-               return statements
+               return resource