diff options
author | Philipp Oeser <info@graphics-engineer.com> | 2020-05-20 16:17:21 +0300 |
---|---|---|
committer | Philipp Oeser <info@graphics-engineer.com> | 2020-05-20 16:17:21 +0300 |
commit | 22c30219e7bcfb019b4b31e4357ce5585582d935 (patch) | |
tree | 99a4979700e7b2980b51e65c209db5075675387f /source | |
parent | 3a5a15836216eac672fcffde9778477ca65b5b2f (diff) | |
parent | d33c27d68bb3dfa6f2a5690657ee820e9d65822c (diff) |
Merge branch 'blender-v2.83-release'
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_ops.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_ops.c b/source/blender/editors/sculpt_paint/paint_ops.c index d607b6a9d6f..c2b771088a8 100644 --- a/source/blender/editors/sculpt_paint/paint_ops.c +++ b/source/blender/editors/sculpt_paint/paint_ops.c @@ -731,7 +731,14 @@ static bool brush_generic_tool_set(bContext *C, WM_main_add_notifier(NC_BRUSH | NA_EDITED, brush); /* Tool System - * This is needed for when there is a non-sculpt tool active (transform for e.g.) */ + * This is needed for when there is a non-sculpt tool active (transform for e.g.). + * In case we are toogling (and the brush changed to the toggle_brush), we need to get the + * tool_name again. */ + int tool_result = brush_tool(brush, paint->runtime.tool_offset); + ePaintMode paint_mode = BKE_paintmode_get_active_from_context(C); + const EnumPropertyItem *items = BKE_paint_get_tool_enum_from_paintmode(paint_mode); + RNA_enum_name_from_value(items, tool_result, &tool_name); + char tool_id[MAX_NAME]; SNPRINTF(tool_id, "builtin_brush.%s", tool_name); WM_toolsystem_ref_set_by_id(C, tool_id); |