diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-11-22 03:13:22 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-11-22 03:13:53 +0300 |
commit | 3b7daa5bf46598267844a3fcf60109b69c5dae1f (patch) | |
tree | 544a3b27617e9aa78470d98f518bb9e292f4a641 /release/scripts/modules | |
parent | 1a4595618c959da17ddec9cef839f8bf654f4727 (diff) |
Tool System: Updates for keymap stored as string
Diffstat (limited to 'release/scripts/modules')
-rw-r--r-- | release/scripts/modules/bl_keymap_utils/keymap_from_toolbar.py | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/release/scripts/modules/bl_keymap_utils/keymap_from_toolbar.py b/release/scripts/modules/bl_keymap_utils/keymap_from_toolbar.py index b5dcb123120..183f13b92fb 100644 --- a/release/scripts/modules/bl_keymap_utils/keymap_from_toolbar.py +++ b/release/scripts/modules/bl_keymap_utils/keymap_from_toolbar.py @@ -197,17 +197,23 @@ def generate(context, space_type): context='INVOKE_REGION_WIN', )[1] elif item.keymap is not None: - kmi_first = item.keymap[0].keymap_items - kmi_first = kmi_first[0] if kmi_first else None - if kmi_first is not None: - kmi_found = wm.keyconfigs.find_item_from_operator( - idname=kmi_first.idname, - # properties=kmi_first.properties, # prevents matches, don't use. - context='INVOKE_REGION_WIN', - )[1] - else: + km = keyconf.keymaps.get(item.keymap[0]) + if km is None: + print("Keymap", repr(item.keymap[0]), "not found for tool", item.text) kmi_found = None - del kmi_first + else: + kmi_first = km.keymap_items + kmi_first = kmi_first[0] if kmi_first else None + if kmi_first is not None: + kmi_found = wm.keyconfigs.find_item_from_operator( + idname=kmi_first.idname, + # properties=kmi_first.properties, # prevents matches, don't use. + context='INVOKE_REGION_WIN', + )[1] + else: + kmi_found = None + del kmi_first + del km else: kmi_found = None item_container[1] = kmi_found |