diff options
author | Campbell Barton <ideasman42@gmail.com> | 2020-10-26 13:10:33 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2020-10-26 13:10:33 +0300 |
commit | 19f74e40228f28fd50b76c4671514f77d76af16c (patch) | |
tree | 1fe4dde90270e44544afe5302aa238ff9de17934 | |
parent | 38ba8a441fb61645f5735e1a8bb800bb143851b4 (diff) | |
parent | cf6c0760464faf0308ca8d3b52fc0a7aaf91a214 (diff) |
Merge branch 'blender-v2.91-release'
-rw-r--r-- | release/scripts/modules/bl_keymap_utils/keymap_from_toolbar.py | 29 |
1 files changed, 19 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 e18cca7fe25..ebc5370a7af 100644 --- a/release/scripts/modules/bl_keymap_utils/keymap_from_toolbar.py +++ b/release/scripts/modules/bl_keymap_utils/keymap_from_toolbar.py @@ -192,16 +192,25 @@ def generate(context, space_type, use_fallback_keys=True, use_reset=True): # PAINT_OT_brush_select mode = context.active_object.mode # See: BKE_paint_get_tool_prop_id_from_paintmode - attr = { - 'SCULPT': "sculpt_tool", - 'VERTEX_PAINT': "vertex_tool", - 'WEIGHT_PAINT': "weight_tool", - 'TEXTURE_PAINT': "image_tool", - 'PAINT_GPENCIL': "gpencil_tool", - 'VERTEX_GPENCIL': "gpencil_vertex_tool", - 'SCULPT_GPENCIL': "gpencil_sculpt_tool", - 'WEIGHT_GPENCIL': "gpencil_weight_tool", - }.get(mode, None) + if space_type == 'IMAGE_EDITOR': + if context.space_data.ui_mode == 'PAINT': + attr = "image_tool" + else: + attr = None + elif space_type == 'VIEW_3D': + attr = { + 'SCULPT': "sculpt_tool", + 'VERTEX_PAINT': "vertex_tool", + 'WEIGHT_PAINT': "weight_tool", + 'TEXTURE_PAINT': "image_tool", + 'PAINT_GPENCIL': "gpencil_tool", + 'VERTEX_GPENCIL': "gpencil_vertex_tool", + 'SCULPT_GPENCIL': "gpencil_sculpt_tool", + 'WEIGHT_GPENCIL': "gpencil_weight_tool", + }.get(mode, None) + else: + attr = None + if attr is not None: setattr(kmi_hack_brush_select_properties, attr, item.data_block) kmi_found = wm.keyconfigs.find_item_from_operator( |