[Bf-blender-cvs] [642c1cabe54] blender2.8: Tool System: Don't add duplicate keymap items

Campbell Barton noreply at git.blender.org
Sat Nov 4 15:32:25 CET 2017


Commit: 642c1cabe5403a527da466bcf9931c602a58efae
Author: Campbell Barton
Date:   Sun Nov 5 01:38:51 2017 +1100
Branches: blender2.8
https://developer.blender.org/rB642c1cabe5403a527da466bcf9931c602a58efae

Tool System: Don't add duplicate keymap items

===================================================================

M	release/scripts/startup/bl_ui/space_toolsystem_common.py

===================================================================

diff --git a/release/scripts/startup/bl_ui/space_toolsystem_common.py b/release/scripts/startup/bl_ui/space_toolsystem_common.py
index 963b2a0b32d..aff9a8d6170 100644
--- a/release/scripts/startup/bl_ui/space_toolsystem_common.py
+++ b/release/scripts/startup/bl_ui/space_toolsystem_common.py
@@ -100,6 +100,9 @@ class ToolSelectPanelHelper:
                     setattr(rna_props, prop_id, value)
 
         km_idname = cls.keymap_prefix + text
+        km = kc.keymaps.get(km_idname)
+        if km is not None:
+            return km, km_idname
         km = kc.keymaps.new(km_idname, space_type=cls.bl_space_type, region_type='WINDOW')
         for op_idname, op_props_dict, kmi_kwargs in actions:
             kmi = km.keymap_items.new(op_idname, **kmi_kwargs)



More information about the Bf-blender-cvs mailing list