[Bf-blender-cvs] [fbe73d1f319] blender2.8: UI: fix error for tools w/o a keymap

Campbell Barton noreply at git.blender.org
Mon May 21 13:08:48 CEST 2018


Commit: fbe73d1f319bf35f37531c9c6b6e3120092a6767
Author: Campbell Barton
Date:   Mon May 21 13:06:59 2018 +0200
Branches: blender2.8
https://developer.blender.org/rBfbe73d1f319bf35f37531c9c6b6e3120092a6767

UI: fix error for tools w/o a keymap

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

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 137e60450d5..717beac1289 100644
--- a/release/scripts/startup/bl_ui/space_toolsystem_common.py
+++ b/release/scripts/startup/bl_ui/space_toolsystem_common.py
@@ -614,8 +614,11 @@ def keymap_from_context(context, space_type):
                 kmi.properties.name = item.text
                 continue
 
-            if item.keymap:
-                kmi_first = item.keymap[0].keymap_items[0]
+            if not item.keymap:
+                continue
+
+            # Only check the first item in the tools key-map (a little arbitrary).
+            kmi_first = item.keymap[0].keymap_items[0]
             kmi_found = wm.keyconfigs.find_item_from_operator(
                 idname=kmi_first.idname,
                 # properties=kmi_first.properties,  # prevents matches, don't use.



More information about the Bf-blender-cvs mailing list