X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=blender%2Fio_mspgl%2Fexport_camera.py;h=02fce103c7f13d1f7fdc7e9fd934bd512c2f9031;hb=db9fa2e2aba82aadc8da3fb8f4f4839419a06d90;hp=1594423a6ee3722faa3c1a70572d890a09c77efe;hpb=2f20c5941aef604c5a49eecebec0fb7f2d2f6dbd;p=libs%2Fgl.git diff --git a/blender/io_mspgl/export_camera.py b/blender/io_mspgl/export_camera.py index 1594423a..02fce103 100644 --- a/blender/io_mspgl/export_camera.py +++ b/blender/io_mspgl/export_camera.py @@ -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]))