]> git.tdb.fi Git - libs/gl.git/blobdiff - blender/io_mspgl/export_armature.py
Refactor object exporter to a separate class
[libs/gl.git] / blender / io_mspgl / export_armature.py
index 1d70b591c3554cd86fd1d11b85bd5988324917fe..f3f18c8adcb1c8f2cf1c2e20bfb93535012c1cd2 100644 (file)
@@ -1,7 +1,5 @@
-from .outfile import OutFile
-
 class ArmatureExporter:
-       def export(self, context, fn):
+       def export(self, context, out_file):
                obj = context.active_object
                if obj.type!="ARMATURE":
                        raise Exception("Can only export Armature data")
@@ -11,7 +9,9 @@ class ArmatureExporter:
                armature = Armature(obj.data)
                armature.sort_links()
 
-               out_file = OutFile(fn)
+               from .outfile import open_outfile
+               out_file = open_outfile(out_file)
+
                for l in armature.links:
                        out_file.begin("link", '"{}"'.format(l.name))
                        out_file.write("index", l.index)