Fix splash screen issue on disabling add-on, by re-registering the original splash class, in unregister phase

This commit is contained in:
doc-code 2024-08-26 16:02:06 +02:00
parent 2992585cd5
commit 06bde7a6b3

View File

@ -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)