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:
authorCampbell Barton <ideasman42@gmail.com>2020-09-18 07:17:17 +0300
committerCampbell Barton <ideasman42@gmail.com>2020-09-18 07:38:23 +0300
commite6978f4d63d130b61de7d8f3bdc497750377ae71 (patch)
tree373e375ac54fc41835ae17e3fb8e6439e8ad6b6d /source/blender/editors/sculpt_paint/paint_image_proj.c
parent14b2de37dbc3563164bb37fb6fe493bf77190948 (diff)
Fix T80885: Texture paint camera project crashes after undo/redo
Unmatched ED_image_undo_push_{begin/end}, add doc-strings noting why this is needed. Thanks to @Baardaap for the initial fix.
Diffstat (limited to 'source/blender/editors/sculpt_paint/paint_image_proj.c')
-rw-r--r--source/blender/editors/sculpt_paint/paint_image_proj.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_image_proj.c b/source/blender/editors/sculpt_paint/paint_image_proj.c
index d44654f4fd5..b0ad3ae1302 100644
--- a/source/blender/editors/sculpt_paint/paint_image_proj.c
+++ b/source/blender/editors/sculpt_paint/paint_image_proj.c
@@ -6091,8 +6091,6 @@ static int texture_paint_camera_project_exec(bContext *C, wmOperator *op)
scene->toolsettings->imapaint.flag |= IMAGEPAINT_DRAWING;
- ED_image_undo_push_begin(op->type->name, PAINT_MODE_TEXTURE_3D);
-
/* allocate and initialize spatial data structures */
project_paint_begin(C, &ps, false, 0);
@@ -6102,6 +6100,8 @@ static int texture_paint_camera_project_exec(bContext *C, wmOperator *op)
return OPERATOR_CANCELLED;
}
+ ED_image_undo_push_begin(op->type->name, PAINT_MODE_TEXTURE_3D);
+
const float pos[2] = {0.0, 0.0};
const float lastpos[2] = {0.0, 0.0};
int a;
@@ -6117,6 +6117,8 @@ static int texture_paint_camera_project_exec(bContext *C, wmOperator *op)
project_paint_end(&ps);
+ ED_image_undo_push_end();
+
scene->toolsettings->imapaint.flag &= ~IMAGEPAINT_DRAWING;
BKE_brush_size_set(scene, ps.brush, orig_brush_size);