diff options
Diffstat (limited to 'source/blender/editors/sculpt_paint/paint_image_proj.c')
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_image_proj.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_image_proj.c b/source/blender/editors/sculpt_paint/paint_image_proj.c index af84cb2d15b..92ca082311a 100644 --- a/source/blender/editors/sculpt_paint/paint_image_proj.c +++ b/source/blender/editors/sculpt_paint/paint_image_proj.c @@ -6140,8 +6140,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); @@ -6150,23 +6148,26 @@ static int texture_paint_camera_project_exec(bContext *C, wmOperator *op) BKE_report(op->reports, RPT_ERROR, "Could not get valid evaluated mesh"); return OPERATOR_CANCELLED; } - else { - float pos[2] = {0.0, 0.0}; - float lastpos[2] = {0.0, 0.0}; - int a; - project_paint_op(&ps, lastpos, pos); + 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; - project_image_refresh_tagged(&ps); + project_paint_op(&ps, lastpos, pos); - for (a = 0; a < ps.image_tot; a++) { - GPU_free_image(ps.projImages[a].ima); - WM_event_add_notifier(C, NC_IMAGE | NA_EDITED, ps.projImages[a].ima); - } + project_image_refresh_tagged(&ps); + + for (a = 0; a < ps.image_tot; a++) { + GPU_free_image(ps.projImages[a].ima); + WM_event_add_notifier(C, NC_IMAGE | NA_EDITED, ps.projImages[a].ima); } 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); |