X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=blender%2Fio_mspgl%2Fexport_camera.py;h=78afbd1235594f62e9350f2ef684570846149687;hb=54c7977189c95d9884fd75b7e32f2d68604ff05c;hp=02fce103c7f13d1f7fdc7e9fd934bd512c2f9031;hpb=db9fa2e2aba82aadc8da3fb8f4f4839419a06d90;p=libs%2Fgl.git diff --git a/blender/io_mspgl/export_camera.py b/blender/io_mspgl/export_camera.py index 02fce103..78afbd12 100644 --- a/blender/io_mspgl/export_camera.py +++ b/blender/io_mspgl/export_camera.py @@ -4,14 +4,14 @@ import mathutils class CameraExporter: def export_camera(self, obj): if obj.type!='CAMERA': - raise ValueError("Object is not a camera") + raise ValueError("Object {} is not a camera".format(obj.name)) from .datafile import Resource, Statement resource = Resource(obj.name+".camera", "camera") - position = obj.matrix_world*mathutils.Vector((0, 0, 0)) + position = obj.matrix_world@mathutils.Vector((0, 0, 0)) resource.statements.append(Statement("position", position[0], position[1], position[2])) - look_dir = obj.matrix_world*mathutils.Vector((0, 0, -1, 0)) + look_dir = obj.matrix_world@mathutils.Vector((0, 0, -1, 0)) resource.statements.append(Statement("look_direction", look_dir[0], look_dir[1], look_dir[2])) resource.statements.append(Statement("up_direction", 0.0, 0.0, 1.0)) resource.statements.append(Statement("field_of_view", obj.data.angle_y*180/math.pi))