[Bf-blender-cvs] [f3782c0a9e4] master: Fix T52195: Sculpt from Python fails

Campbell Barton noreply at git.blender.org
Fri Jul 28 21:51:48 CEST 2017


Commit: f3782c0a9e44cc56680b0682d0eb78d2974bb593
Author: Campbell Barton
Date:   Sat Jul 29 05:59:17 2017 +1000
Branches: master
https://developer.blender.org/rBf3782c0a9e44cc56680b0682d0eb78d2974bb593

Fix T52195: Sculpt from Python fails

When calling sculpt from Python,
setting 3D 'location' but not 2D 'mouse' stopped working in 2.78.

Now check if the operator is running non-interactively and
skip the mouse-over check.

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

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

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

diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c
index 44cc2720a32..f0c1203004e 100644
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@ -4656,8 +4656,11 @@ static bool sculpt_stroke_test_start(bContext *C, struct wmOperator *op,
                                     const float mouse[2])
 {
 	/* Don't start the stroke until mouse goes over the mesh.
-	 * note: mouse will only be null when re-executing the saved stroke. */
-	if (!mouse || over_mesh(C, op, mouse[0], mouse[1])) {
+	 * note: mouse will only be null when re-executing the saved stroke.
+	 * We have exception for 'exec' strokes since they may not set 'mouse', only 'location', see: T52195. */
+	if (((op->flag & OP_IS_INVOKE) == 0) ||
+	    (mouse == NULL) || over_mesh(C, op, mouse[0], mouse[1]))
+	{
 		Object *ob = CTX_data_active_object(C);
 		SculptSession *ss = ob->sculpt;
 		Sculpt *sd = CTX_data_tool_settings(C)->sculpt;




More information about the Bf-blender-cvs mailing list