]> git.tdb.fi Git - libs/gl.git/blobdiff - blender/io_mspgl/export_camera.py
Redesign object exporting
[libs/gl.git] / blender / io_mspgl / export_camera.py
index 1594423a6ee3722faa3c1a70572d890a09c77efe..02fce103c7f13d1f7fdc7e9fd934bd512c2f9031 100644 (file)
@@ -2,21 +2,12 @@ import math
 import mathutils
 
 class CameraExporter:
-       def export_to_file(self, context, out_fn):
-               obj = context.active_object
-
-               resource = self.export_camera(obj)
-
-               with open(out_fn, "w") as out_file:
-                       for s in resource.statements:
-                               s.write_to_file(out_file)
-
        def export_camera(self, obj):
                if obj.type!='CAMERA':
-                       raise Exception("Object is not a camera")
+                       raise ValueError("Object is not a camera")
 
                from .datafile import Resource, Statement
-               resource = Resource(obj.name+".camera")
+               resource = Resource(obj.name+".camera", "camera")
 
                position = obj.matrix_world*mathutils.Vector((0, 0, 0))
                resource.statements.append(Statement("position", position[0], position[1], position[2]))