diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-06-06 12:05:05 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-06-06 12:06:18 +0300 |
commit | 3325b19ee7fd0df489f818c59b619e0e84c74afb (patch) | |
tree | 2c550b5ce4909cb9dc5b905b3a21165ef0ff7595 /release/scripts | |
parent | 0f26332d5d9a5cb6363afb3416a1bebd0d936230 (diff) |
Fix T64788: Double keymap entry in preferences
A display issue for tools which share keymaps.
Diffstat (limited to 'release/scripts')
-rw-r--r-- | release/scripts/startup/bl_ui/space_toolsystem_common.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/release/scripts/startup/bl_ui/space_toolsystem_common.py b/release/scripts/startup/bl_ui/space_toolsystem_common.py index c0bb50b6597..1d401ebd2c9 100644 --- a/release/scripts/startup/bl_ui/space_toolsystem_common.py +++ b/release/scripts/startup/bl_ui/space_toolsystem_common.py @@ -379,11 +379,20 @@ class ToolSelectPanelHelper: @classmethod def keymap_ui_hierarchy(cls, context_mode): # See: bpy_extras.keyconfig_utils + + # Keymaps may be shared, don't show them twice. + visited = set() + for context_mode_test, tools in cls.tools_all(): if context_mode_test == context_mode: for item in cls._tools_flatten_with_keymap(tools): km_name = item.keymap[0] # print((km.name, cls.bl_space_type, 'WINDOW', [])) + + if km_name in visited: + continue + visited.add(km_name) + yield (km_name, cls.bl_space_type, 'WINDOW', []) # ------------------------------------------------------------------------- |