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
path: root/source
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2017-07-28 22:59:17 +0300
committerCampbell Barton <ideasman42@gmail.com>2017-07-28 23:05:43 +0300
commitf3782c0a9e44cc56680b0682d0eb78d2974bb593 (patch)
treed2661aa47888707f5be7cfd1ef710cf8cb065a36 /source
parente2a7e1e4940109c09de2b0e2fc22029de3636936 (diff)
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.
Diffstat (limited to 'source')
-rw-r--r--source/blender/editors/sculpt_paint/sculpt.c7
1 files changed, 5 insertions, 2 deletions
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;