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-07-02 18:32:52 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-07-02 18:33:34 +0300
commit94bc1a40b44d6b6a955aa8ac56e6dc203f2f5cef (patch)
tree8ed81691d754dd08909445f41feb9d17490a9c8b /source/blender/editors/sculpt_paint/paint_ops.c
parent778b272552157cfc5b9159f559d01e1f58900f48 (diff)
Fix sculpt key bindings
Diffstat (limited to 'source/blender/editors/sculpt_paint/paint_ops.c')
-rw-r--r--source/blender/editors/sculpt_paint/paint_ops.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_ops.c b/source/blender/editors/sculpt_paint/paint_ops.c
index c286d41f4b0..f89236dbbc1 100644
--- a/source/blender/editors/sculpt_paint/paint_ops.c
+++ b/source/blender/editors/sculpt_paint/paint_ops.c
@@ -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)