diff options
author | Vilém Duha <vilda.novak@gmail.com> | 2019-07-24 09:40:42 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-07-24 17:19:59 +0300 |
commit | f3ee44380d01ab69b2b007409e7d6a9ec143beb2 (patch) | |
tree | 94f7917c106319020c4d8c05da4e4c7993b09c66 | |
parent | 03e517b770682ddb6a9dcf56e72b48a2a9b7b1e2 (diff) |
BlenderKit: fix T67565, unregistration could go wrong in combo with other addons since addon was un-registering whole keymapv2.80-rc3
-rw-r--r-- | blenderkit/ui.py | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/blenderkit/ui.py b/blenderkit/ui.py index 40a10904..d58c489b 100644 --- a/blenderkit/ui.py +++ b/blenderkit/ui.py @@ -1648,8 +1648,8 @@ classess = ( ) -# store keymaps here to access after registration -addon_keymaps = [] +# store keymap items here to access after registration +addon_keymapitems = [] def register_ui(): @@ -1673,7 +1673,7 @@ def register_ui(): kmi.properties.keep_running = False kmi.properties.do_search = False - addon_keymaps.append(km) + addon_keymapitems.append(kmi) def unregister_ui(): @@ -1685,12 +1685,11 @@ def unregister_ui(): for c in classess: bpy.utils.unregister_class(c) - args = (None, bpy.context) - wm = bpy.context.window_manager if not wm.keyconfigs.addon: return - for km in addon_keymaps: - wm.keyconfigs.addon.keymaps.remove(km) - del addon_keymaps[:] + km = wm.keyconfigs.addon.keymaps['Window'] + for kmi in addon_keymapitems: + km.keymap_items.remove(kmi) + del addon_keymapitems[:] |