resource = self.export_camera(obj)
- with open(out_fn, "w") as out_file:
- for s in resource.statements:
- s.write_to_file(out_file)
+ resource.write_to_file(out_fn)
def export_camera(self, obj):
if obj.type!='CAMERA':
raise Exception("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]))