Fix sculpt key bindings

This commit is contained in:
Campbell Barton 2018-07-02 17:32:52 +02:00
parent 778b272552
commit 94bc1a40b4
1 changed files with 10 additions and 12 deletions

View File

@ -455,21 +455,19 @@ static int brush_select_exec(bContext *C, wmOperator *op)
/* TODO(campbell): Use the toolsystem for now, ideally the toolsystem will display brushes directly
* so we don't need to sync between tools and brushes. */
if (false) {
return brush_generic_tool_set(
bmain, paint, tool, tool_offset,
paint_mode, tool_name, create_missing,
toggle);
}
else {
int ret = brush_generic_tool_set(
bmain, paint, tool, tool_offset,
paint_mode, tool_name, create_missing,
toggle);
if ((ret == OPERATOR_FINISHED) && (paint->brush != NULL)) {
Brush *brush = paint->brush;
WorkSpace *workspace = CTX_wm_workspace(C);
if (WM_toolsystem_ref_set_by_name(C, workspace, NULL, tool_name, true)) {
return OPERATOR_FINISHED;
}
else {
return OPERATOR_CANCELLED;
if (WM_toolsystem_ref_set_by_name(C, workspace, NULL, brush->id.name + 2, true)) {
/* ok */
}
}
return ret;
}
static void PAINT_OT_brush_select(wmOperatorType *ot)