import bpy

from .auth_operator import (
    WM_OT_threedripper_helper_login,
    WM_OT_threedripper_helper_logout,
    WM_OT_threedripper_helper_refresh_access,
)
from .operator import IMPORT_SCENE_OT_threedripper_helper_ir, menu_func_import
from .panel import VIEW3D_PT_threedripper_helper
from .preferences import THREEDRIPPER_HELPER_Preferences
from .update_operator import WM_OT_threedripper_helper_check_update

bl_info = {
    "name": "3DRipper Helper",
    "author": "3d-core contributors",
    "blender": (4, 2, 0),
    "version": (0, 1, 18),
    "description": "Import editable Blender Scene IR packages exported by 3DRipper",
    "support": "COMMUNITY",
    "category": "Import-Export",
}

CLASSES = (
    THREEDRIPPER_HELPER_Preferences,
    WM_OT_threedripper_helper_login,
    WM_OT_threedripper_helper_refresh_access,
    WM_OT_threedripper_helper_logout,
    WM_OT_threedripper_helper_check_update,
    IMPORT_SCENE_OT_threedripper_helper_ir,
    VIEW3D_PT_threedripper_helper,
)


def register():
    for cls in CLASSES:
        bpy.utils.register_class(cls)
    bpy.types.TOPBAR_MT_file_import.append(menu_func_import)


def unregister():
    bpy.types.TOPBAR_MT_file_import.remove(menu_func_import)
    for cls in reversed(CLASSES):
        bpy.utils.unregister_class(cls)
