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-06 11:23:51 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-09-06 11:28:33 +0300
commit5f669240663649ee5532f935a8178bf9db7b10cf (patch)
treeb74cfbaff2d91b21737ed4661b89e4e2b5eae050 /release/scripts/startup/bl_ui/space_toolsystem_common.py
parent8d3c641270e8d6bc7bc56953d17af3634b394b00 (diff)
Fix exception w/ grease pencil brush tooltips
Diffstat (limited to 'release/scripts/startup/bl_ui/space_toolsystem_common.py')
-rw-r--r--release/scripts/startup/bl_ui/space_toolsystem_common.py23
1 files changed, 15 insertions, 8 deletions
diff --git a/release/scripts/startup/bl_ui/space_toolsystem_common.py b/release/scripts/startup/bl_ui/space_toolsystem_common.py
index ba06a4e4b50..37f3138fea8 100644
--- a/release/scripts/startup/bl_ui/space_toolsystem_common.py
+++ b/release/scripts/startup/bl_ui/space_toolsystem_common.py
@@ -769,14 +769,21 @@ def keymap_from_context(context, space_type):
'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_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]
+ }.get(mode, (None, None))
+ if attr_op is not None:
+ kmi_hack_brush_select_properties.paint_mode = mode
+ 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]
+ elif mode == 'GPENCIL_PAINT':
+ # TODO: gpencil.brush_select
+ # By default no keys are mapped to this, pass.
+ pass
+ else:
+ print("Unsupported mode:", mode)
del mode, attr_op, attr_brush
else: