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:
-rw-r--r--source/blender/blenkernel/intern/brush.c2
-rw-r--r--source/blender/editors/sculpt_paint/paint_image_proj.c3
-rw-r--r--source/blender/editors/sculpt_paint/paint_stroke.c4
3 files changed, 4 insertions, 5 deletions
diff --git a/source/blender/blenkernel/intern/brush.c b/source/blender/blenkernel/intern/brush.c
index 70b5d90120d..09f53281dbe 100644
--- a/source/blender/blenkernel/intern/brush.c
+++ b/source/blender/blenkernel/intern/brush.c
@@ -951,7 +951,6 @@ float BKE_brush_curve_strength_clamp(Brush *br, float p, const float len)
if (p >= len) return 0;
else p = p / len;
- curvemapping_initialize(br->curve);
strength = curvemapping_evaluateF(br->curve, 0, p);
CLAMP(strength, 0.0f, 1.0f);
@@ -967,7 +966,6 @@ float BKE_brush_curve_strength(Brush *br, float p, const float len)
else
p = p / len;
- curvemapping_initialize(br->curve);
return curvemapping_evaluateF(br->curve, 0, p);
}
diff --git a/source/blender/editors/sculpt_paint/paint_image_proj.c b/source/blender/editors/sculpt_paint/paint_image_proj.c
index db55dc271f1..43377d2bb90 100644
--- a/source/blender/editors/sculpt_paint/paint_image_proj.c
+++ b/source/blender/editors/sculpt_paint/paint_image_proj.c
@@ -4279,9 +4279,6 @@ void *paint_proj_new_stroke(bContext *C, Object *ob, const float mouse[2], int m
return ps;
}
- /* needed so multiple threads don't try to initialize the brush at once (can leak memory) */
- curvemapping_initialize(ps->brush->curve);
-
paint_brush_init_tex(ps->brush);
ps->source = PROJ_SRC_VIEW;
diff --git a/source/blender/editors/sculpt_paint/paint_stroke.c b/source/blender/editors/sculpt_paint/paint_stroke.c
index 36e1b1feb38..e41d4a741ae 100644
--- a/source/blender/editors/sculpt_paint/paint_stroke.c
+++ b/source/blender/editors/sculpt_paint/paint_stroke.c
@@ -46,6 +46,7 @@
#include "BKE_context.h"
#include "BKE_paint.h"
#include "BKE_brush.h"
+#include "BKE_colortools.h"
#include "WM_api.h"
#include "WM_types.h"
@@ -477,6 +478,9 @@ PaintStroke *paint_stroke_new(bContext *C,
stroke->redraw = redraw;
stroke->done = done;
stroke->event_type = event_type; /* for modal, return event */
+
+ /* initialize here to avoid initialization conflict with threaded strokes */
+ curvemapping_initialize(br->curve);
BKE_paint_set_overlay_override(br->overlay_flags);