diff options
author | Antonio Vazquez <blendergit@gmail.com> | 2020-06-25 18:13:21 +0300 |
---|---|---|
committer | Antonio Vazquez <blendergit@gmail.com> | 2020-06-25 18:13:34 +0300 |
commit | 47ff54b0080b5015244cd64a4f69f3baca2c5ab0 (patch) | |
tree | 821efa2253c45558b2f3e19bbcfdc13ea6036091 | |
parent | 495b0eff9a2d5e3f32c6fd954107bfbf709f33c3 (diff) |
GPencil: Ensure previous brush is set when change mode
In some situations, the previous brush is not set. This usually happens with previous version files.
Related to T78155.
-rw-r--r-- | source/blender/blenkernel/intern/brush.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/brush.c b/source/blender/blenkernel/intern/brush.c index 0a991d3ef4a..417fd182e73 100644 --- a/source/blender/blenkernel/intern/brush.c +++ b/source/blender/blenkernel/intern/brush.c @@ -1185,6 +1185,11 @@ void BKE_brush_gpencil_paint_presets(Main *bmain, ToolSettings *ts, const bool r if (reset || brush_prev == NULL) { BKE_paint_brush_set(paint, deft_draw); } + else { + if (brush_prev != NULL) { + BKE_paint_brush_set(paint, brush_prev); + } + } } /* Create a set of grease pencil Vertex Paint presets. */ @@ -1227,6 +1232,11 @@ void BKE_brush_gpencil_vertex_presets(Main *bmain, ToolSettings *ts, const bool if (reset || brush_prev == NULL) { BKE_paint_brush_set(vertexpaint, deft_vertex); } + else { + if (brush_prev != NULL) { + BKE_paint_brush_set(vertexpaint, brush_prev); + } + } } /* Create a set of grease pencil Sculpt Paint presets. */ @@ -1297,6 +1307,11 @@ void BKE_brush_gpencil_sculpt_presets(Main *bmain, ToolSettings *ts, const bool if (reset || brush_prev == NULL) { BKE_paint_brush_set(sculptpaint, deft_sculpt); } + else { + if (brush_prev != NULL) { + BKE_paint_brush_set(sculptpaint, brush_prev); + } + } } /* Create a set of grease pencil Weight Paint presets. */ @@ -1318,6 +1333,11 @@ void BKE_brush_gpencil_weight_presets(Main *bmain, ToolSettings *ts, const bool if (reset || brush_prev == NULL) { BKE_paint_brush_set(weightpaint, deft_weight); } + else { + if (brush_prev != NULL) { + BKE_paint_brush_set(weightpaint, brush_prev); + } + } } struct Brush *BKE_brush_first_search(struct Main *bmain, const eObjectMode ob_mode) |