def add_empty(empty_name, collection=None):
    """Add an empty to the scene."""
    if collection is None:
        collection = bpy.context.collection
    empty_obj = bpy.data.objects.new(empty_name, None)
    collection.objects.link(empty_obj)
    return empty_obj
Add an empty to the scene.
photogrammetry_importer/blender_utility/object_utility.py