[Bf-blender-cvs] [6ac0d35] master: Fix T47534: Crash w/ project-paint from Python

Campbell Barton noreply at git.blender.org
Tue Feb 23 14:08:08 CET 2016


Commit: 6ac0d357d68d35dc24be9c77fc48abfe20fb3657
Author: Campbell Barton
Date:   Tue Feb 23 23:47:30 2016 +1100
Branches: master
https://developer.blender.org/rB6ac0d357d68d35dc24be9c77fc48abfe20fb3657

Fix T47534: Crash w/ project-paint from Python

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

M	source/blender/editors/sculpt_paint/paint_stroke.c

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

diff --git a/source/blender/editors/sculpt_paint/paint_stroke.c b/source/blender/editors/sculpt_paint/paint_stroke.c
index bf1a2fa..31d4e6b 100644
--- a/source/blender/editors/sculpt_paint/paint_stroke.c
+++ b/source/blender/editors/sculpt_paint/paint_stroke.c
@@ -1237,15 +1237,16 @@ int paint_stroke_exec(bContext *C, wmOperator *op)
 {
 	PaintStroke *stroke = op->customdata;
 
-	/* only when executed for the first time */
-	if (stroke->stroke_started == 0) {
-		/* XXX stroke->last_mouse_position is unset, this may cause problems */
-		stroke->test_start(C, op, NULL);
-		stroke->stroke_started = 1;
-	}
-
 	RNA_BEGIN (op->ptr, itemptr, "stroke")
 	{
+		/* only when executed for the first time */
+		if (stroke->stroke_started == 0) {
+			float mval[2];
+			RNA_float_get_array(&itemptr, "mouse", mval);
+			stroke->test_start(C, op, mval);
+			stroke->stroke_started = 1;
+		}
+
 		stroke->update_step(C, stroke, &itemptr);
 	}
 	RNA_END;




More information about the Bf-blender-cvs mailing list