import bpy from mathutils import Vector sc = bpy.context.scene cam = bpy.data.objects["Camera"] sc.camera = cam cam.location = CAM[0] cam.rotation_euler = (Vector(CAM[1]) - Vector(CAM[0])).to_track_quat('-Z', 'Y').to_euler() cam.data.lens = CAM[2] cam.data.clip_start = 0.05 sc.render.resolution_x, sc.render.resolution_y = RES sc.render.filepath = OUTP sc.render.image_settings.file_format = 'PNG' bpy.ops.render.render(write_still=True)