From 06bde7a6b359131d7fc56f99fc12b1ffb926b993 Mon Sep 17 00:00:00 2001 From: doc-code Date: Mon, 26 Aug 2024 16:02:06 +0200 Subject: [PATCH] Fix splash screen issue on disabling add-on, by re-registering the original splash class, in unregister phase --- addon/__init__.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/addon/__init__.py b/addon/__init__.py index cdc840a..cd8ca2b 100644 --- a/addon/__init__.py +++ b/addon/__init__.py @@ -46,7 +46,11 @@ classes = [WM_MT_splash, OT_SelectTemplatePopup, CustomTemplatesPreferences] +original_splash = None; + def register(): + global original_splash + original_splash = bpy.types.WM_MT_splash; for c in classes: bpy.utils.register_class(c) bpy.types.TOPBAR_MT_file_new.append(draw_file_new_templates) @@ -55,6 +59,7 @@ def register(): def unregister(): for c in reversed(classes): bpy.utils.unregister_class(c) + bpy.utils.register_class(original_splash) bpy.types.TOPBAR_MT_file_new.remove(draw_file_new_templates) bpy.types.TOPBAR_MT_file_defaults.remove(draw_file_default_operators)