[Bf-blender-cvs] [ba61c01] soc-2013-paint: Fix some undo issues with paint curves.

Antony Riakiotakis noreply at git.blender.org
Wed Jul 16 18:41:26 CEST 2014


Commit: ba61c0164a3c054f9dc53e089feff892ff8dc6cc
Author: Antony Riakiotakis
Date:   Wed Jul 16 19:41:19 2014 +0300
https://developer.blender.org/rBba61c0164a3c054f9dc53e089feff892ff8dc6cc

Fix some undo issues with paint curves.

===================================================================

M	source/blender/editors/sculpt_paint/paint_curve.c
M	source/blender/editors/sculpt_paint/paint_ops.c

===================================================================

diff --git a/source/blender/editors/sculpt_paint/paint_curve.c b/source/blender/editors/sculpt_paint/paint_curve.c
index ca608b4..82fe2fb 100644
--- a/source/blender/editors/sculpt_paint/paint_curve.c
+++ b/source/blender/editors/sculpt_paint/paint_curve.c
@@ -338,7 +338,7 @@ void PAINTCURVE_OT_add_point(wmOperatorType *ot)
 	ot->poll = paint_curve_poll;
 
 	/* flags */
-	ot->flag = OPTYPE_UNDO;
+	ot->flag = OPTYPE_UNDO | OPTYPE_REGISTER;
 
 	/* properties */
 	RNA_def_int_vector(ot->srna, "location", 2, NULL, 0, SHRT_MAX,
@@ -557,7 +557,7 @@ void PAINTCURVE_OT_select(wmOperatorType *ot)
 	ot->poll = paint_curve_poll;
 
 	/* flags */
-	ot->flag = OPTYPE_UNDO;
+	ot->flag = OPTYPE_UNDO | OPTYPE_REGISTER;
 
 	/* properties */
 	RNA_def_int_vector(ot->srna, "location", 2, NULL, 0, SHRT_MAX,
@@ -621,7 +621,8 @@ static int paintcurve_slide_invoke(bContext *C, wmOperator *op, const wmEvent *e
 		psd->align = align;
 		op->customdata = psd;
 
-		paintcurve_undo_begin(C, op, pc);
+		if (do_select)
+			paintcurve_undo_begin(C, op, pc);
 
 		/* first, clear all selection from points */
 		for (i = 0; i < pc->tot_points; i++)
diff --git a/source/blender/editors/sculpt_paint/paint_ops.c b/source/blender/editors/sculpt_paint/paint_ops.c
index bf82410..e239043 100644
--- a/source/blender/editors/sculpt_paint/paint_ops.c
+++ b/source/blender/editors/sculpt_paint/paint_ops.c
@@ -1036,7 +1036,7 @@ void ED_operatormacros_paint(void)
 	wmOperatorTypeMacro *otmacro;
 
 	ot = WM_operatortype_append_macro("PAINTCURVE_OT_add_point_slide", "Add Curve Point and Slide",
-	                                  "Add new curve point and slide it", OPTYPE_REGISTER);
+	                                  "Add new curve point and slide it", OPTYPE_UNDO);
 	ot->description = "Add new curve point and slide it";
 	WM_operatortype_macro_define(ot, "PAINTCURVE_OT_add_point");
 	otmacro = WM_operatortype_macro_define(ot, "PAINTCURVE_OT_slide");




More information about the Bf-blender-cvs mailing list