]> git.tdb.fi Git - libs/gl.git/blobdiff - blender/io_mspgl/export.py
Replace the instance variables of exporters by function parameters
[libs/gl.git] / blender / io_mspgl / export.py
index 37813d081a0d1bebf2cf5407431b59dce6de4589..cf4312d2631993aeb37d7e4d9fd925c70952ff1f 100644 (file)
@@ -2,11 +2,7 @@ import os
 import itertools
 
 class DataExporter:
-       def __init__(self):
-               self.collection = False
-               self.shared_resources = True
-
-       def export_to_file(self, context, out_fn):
+       def export_to_file(self, context, out_fn, *, collection=False, shared_resources=False):
                from .util import Progress
                progress = Progress(context)
 
@@ -21,7 +17,7 @@ class DataExporter:
                base, ext = os.path.splitext(base)
 
                refs = dummy_res.collect_references()
-               if not self.shared_resources:
+               if not shared_resources:
                        numbers = {}
                        for r in refs:
                                res_ext = os.path.splitext(r.name)[1]
@@ -32,7 +28,7 @@ class DataExporter:
                                        r.name = base+res_ext
                                numbers[res_ext] = n+1
 
-               if self.collection:
+               if collection:
                        dummy_res.write_collection(out_fn, exclude_self=True)
                else:
                        for r in refs: