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:
authorPablo Dobarro <pablodp606@gmail.com>2020-04-06 20:35:42 +0300
committerPablo Dobarro <pablodp606@gmail.com>2020-04-14 21:55:38 +0300
commitf881ff129f785ed9491be04bc3dad6645903ddaa (patch)
tree232e87d0b9ef41dcd1970649edbe1304d7945656 /source/blender/editors/sculpt_paint
parentf12589d335d49f537b47403e7c7a4136b6a1f472 (diff)
Fix Shift-Smooth mode using wrong parameters
When using the shift-smooth mode, sculpt_update_cache_invariants is changing the brush datablock of the paint session if it finds a brush named "Smooth" (which is a huge hack the brush management project should try to solve). This is done after the PaintStroke data in the modal operator is created, which holds a reference to the active brush in the paint session that was active when the operator started. Because of this, the StrokeCache was getting the correct smooth brush values but the paint modal operator was applying the wrong ones from the previous brush. This was causing the smooth brush behaves unpredictably depending on the current active brush. This patch updates the brush in PaintStroke on each modal callback, so it always gets the values from the current active brush in the Paint Session. The way brush switching works and a way to make it more flexible needs to be discussed in the future as part of the brush management project. The default smooth brush parameters and curves will probably need to be updated after this change, as previously they were set using an incorrect behavior. Reviewed By: jbakker Differential Revision: https://developer.blender.org/D7354
Diffstat (limited to 'source/blender/editors/sculpt_paint')
-rw-r--r--source/blender/editors/sculpt_paint/paint_stroke.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_stroke.c b/source/blender/editors/sculpt_paint/paint_stroke.c
index e7bc75be45d..7887aaaf658 100644
--- a/source/blender/editors/sculpt_paint/paint_stroke.c
+++ b/source/blender/editors/sculpt_paint/paint_stroke.c
@@ -1340,7 +1340,7 @@ int paint_stroke_modal(bContext *C, wmOperator *op, const wmEvent *event)
Paint *p = BKE_paint_get_active_from_context(C);
ePaintMode mode = BKE_paintmode_get_active_from_context(C);
PaintStroke *stroke = op->customdata;
- Brush *br = stroke->brush;
+ Brush *br = stroke->brush = BKE_paint_brush(p);
PaintSample sample_average;
float mouse[2];
bool first_dab = false;