Fix exception w/ grease pencil brush tooltips

This commit is contained in:
Campbell Barton
2018-09-06 18:23:51 +10:00
parent 8d3c641270
commit 5f66924066

View File

@@ -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: