Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2018-09-04 01:09:48 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-09-04 01:13:54 +0300
commitf428efc6db374579a56c1006ec0b1dc873b50938 (patch)
treeac4d2abc133378a664849b2b952bdc6ce8403720 /release
parent549592274ab1898966a24c1413fe8df3f7f2e35f (diff)
Correct toolbar tips for non sculpt modes
Diffstat (limited to 'release')
-rw-r--r--release/scripts/startup/bl_ui/space_toolsystem_common.py17
1 files changed, 8 insertions, 9 deletions
diff --git a/release/scripts/startup/bl_ui/space_toolsystem_common.py b/release/scripts/startup/bl_ui/space_toolsystem_common.py
index 191cae2ea20..ba06a4e4b50 100644
--- a/release/scripts/startup/bl_ui/space_toolsystem_common.py
+++ b/release/scripts/startup/bl_ui/space_toolsystem_common.py
@@ -763,22 +763,21 @@ def keymap_from_context(context, space_type):
# PAINT_OT_brush_select
brush = bpy.data.brushes.get(item.data_block)
if brush is not None:
- # print(dir(brush))
- mode = context.mode
- attr = {
- 'SCULPT': "sculpt_tool",
- 'VERTEX_PAINT': "vertex_paint_tool",
- 'WEIGHT_PAINT': "weight_paint_tool",
- 'TEXTURE_PAINT': "texture_paint_tool",
+ mode = context.active_object.mode
+ attr_op, attr_brush = {
+ 'SCULPT': ("sculpt_tool", "sculpt_tool"),
+ 'WEIGHT_PAINT': ("weight_paint_tool", "vertex_tool"),
+ 'VERTEX_PAINT': ("vertex_paint_tool", "vertex_tool"),
+ 'TEXTURE_PAINT': ("texture_paint_tool", "image_tool"),
}[mode]
kmi_hack_brush_select_properties.paint_mode = mode
- setattr(kmi_hack_brush_select_properties, attr, getattr(brush, attr))
+ setattr(kmi_hack_brush_select_properties, attr_op, getattr(brush, attr_brush))
kmi_found = wm.keyconfigs.find_item_from_operator(
idname="paint.brush_select",
context='INVOKE_REGION_WIN',
properties=kmi_hack_brush_select_properties,
)[1]
- del mode, attr
+ del mode, attr_op, attr_brush
else:
kmi_found = None