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:
Diffstat (limited to 'source/blender/editors/sculpt_paint/paint_image.c')
-rw-r--r--source/blender/editors/sculpt_paint/paint_image.c25
1 files changed, 11 insertions, 14 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c
index 8c9531e5554..fa8252c824d 100644
--- a/source/blender/editors/sculpt_paint/paint_image.c
+++ b/source/blender/editors/sculpt_paint/paint_image.c
@@ -42,7 +42,6 @@
#include "BLI_math.h"
#include "BLI_blenlib.h"
-#include "BLI_dynstr.h"
#include "BLI_linklist.h"
#include "BLI_memarena.h"
#include "BLI_threads.h"
@@ -54,13 +53,9 @@
#include "IMB_imbuf_types.h"
#include "DNA_brush_types.h"
-#include "DNA_camera_types.h"
#include "DNA_mesh_types.h"
-#include "DNA_meshdata_types.h"
#include "DNA_node_types.h"
#include "DNA_object_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_texture_types.h"
#include "BKE_camera.h"
#include "BKE_context.h"
@@ -77,8 +72,7 @@
#include "BKE_paint.h"
#include "BKE_report.h"
#include "BKE_scene.h"
-#include "BKE_global.h"
-#include "BKE_deform.h"
+#include "BKE_colortools.h"
#include "BKE_tessmesh.h"
@@ -102,7 +96,6 @@
#include "RNA_enum_types.h"
#include "GPU_draw.h"
-#include "GPU_extensions.h"
#include "IMB_colormanagement.h"
@@ -5142,15 +5135,16 @@ static int texture_paint_init(bContext *C, wmOperator *op)
return 0;
}
}
-
- paint_brush_init_tex(pop->s.brush);
-
+
/* note, if we have no UVs on the derived mesh, then we must return here */
if (pop->mode == PAINT_MODE_3D_PROJECT) {
/* initialize all data from the context */
project_state_init(C, OBACT, &pop->ps);
-
+
+ /* needed so multiple threads don't try to initialize the brush at once (can leak memory) */
+ curvemapping_initialize(pop->ps.brush->curve);
+
paint_brush_init_tex(pop->ps.brush);
pop->ps.source = PROJ_SRC_VIEW;
@@ -5168,6 +5162,9 @@ static int texture_paint_init(bContext *C, wmOperator *op)
if (pop->ps.dm == NULL)
return 0;
}
+ else {
+ paint_brush_init_tex(pop->s.brush);
+ }
settings->imapaint.flag |= IMAGEPAINT_DRAWING;
undo_paint_push_begin(UNDO_PAINT_IMAGE, op->type->name,
@@ -5237,8 +5234,6 @@ static void paint_exit(bContext *C, wmOperator *op)
if (pop->restore_projection)
settings->imapaint.flag &= ~IMAGEPAINT_PROJECT_DISABLE;
- paint_brush_exit_tex(pop->s.brush);
-
settings->imapaint.flag &= ~IMAGEPAINT_DRAWING;
imapaint_canvas_free(&pop->s);
BKE_brush_painter_free(pop->painter);
@@ -5250,6 +5245,8 @@ static void paint_exit(bContext *C, wmOperator *op)
project_paint_end(&pop->ps);
}
else {
+ paint_brush_exit_tex(pop->s.brush);
+
/* non projection 3d paint, could move into own function of more needs adding */
if (pop->s.dm_release)
pop->s.dm->release(pop->s.dm);