import bpy from . import runtime from .image_depth import ( ApplyRemovedBackground, BuildDepthPlane, BuildOriginalDepthPlane, ConvertImageToDepthPlane, RemoveImageBackground, SnapFormImageMenu, draw_image_context_menu, ) from .image_mesh import BuildImageMesh, ConvertImageToMesh from .operators import ( CancelJob, ControlHost, RunJob, cancel_active_job, close_active_job, ) from .panel import ( Ben2RemovalDebugPanel, Da3OutputDebugPanel, DebugPanel, HostPanel, ModelsPanel, ) from .preferences import SnapFormPreferences from .properties import SnapFormSettings from .status_bar import draw_status_bar CLASSES = ( SnapFormPreferences, SnapFormSettings, RunJob, CancelJob, ControlHost, SnapFormImageMenu, ApplyRemovedBackground, RemoveImageBackground, BuildDepthPlane, BuildOriginalDepthPlane, ConvertImageToDepthPlane, BuildImageMesh, ConvertImageToMesh, HostPanel, ModelsPanel, DebugPanel, Da3OutputDebugPanel, Ben2RemovalDebugPanel, ) def register(): for class_type in CLASSES: bpy.utils.register_class(class_type) bpy.types.Scene.snapform_settings = bpy.props.PointerProperty( type=SnapFormSettings, ) bpy.types.STATUSBAR_HT_header.append(draw_status_bar) bpy.types.VIEW3D_MT_object_context_menu.append(draw_image_context_menu) runtime.schedule_host_start() def unregister(): cancel_active_job() close_active_job() runtime.unschedule_host() runtime.detach_host_client() bpy.types.VIEW3D_MT_object_context_menu.remove(draw_image_context_menu) bpy.types.STATUSBAR_HT_header.remove(draw_status_bar) if hasattr(bpy.types.Scene, "snapform_settings"): del bpy.types.Scene.snapform_settings for class_type in reversed(CLASSES): bpy.utils.unregister_class(class_type)