def get_selected_camera():
    """Get the selected camera or return None."""
    selected_obj = get_selected_object()
    if selected_obj is None:
        return None
    elif selected_obj.type == "CAMERA":
        return selected_obj
    else:
        return None
Get the selected camera or return None.
photogrammetry_importer/blender_utility/retrieval_utility.py