def _add_camera_data(camera, camera_name):
    """Add a camera as Blender data entity."""
    bcamera = bpy.data.cameras.new(camera_name)
    if camera.is_panoramic():
        bcamera.type = "PANO"
        bcamera.cycles.panorama_type = camera.get_panoramic_type()
    #  Adjust field of view
    bcamera.angle = camera.get_field_of_view()
    bcamera.shift_x, bcamera.shift_y = compute_principal_point_shift(
        camera, relativ_to_largest_extend=True
    )
    return bcamera
Add a camera as Blender data entity.
photogrammetry_importer/importers/camera_utility.py