diff options
author | Campbell Barton <ideasman42@gmail.com> | 2016-02-23 15:47:30 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2016-02-23 16:00:23 +0300 |
commit | 6ac0d357d68d35dc24be9c77fc48abfe20fb3657 (patch) | |
tree | 63c515b4e2b6fe3d1679ba99091b39c143dd4b86 /source/blender/editors/sculpt_paint/paint_stroke.c | |
parent | 56da420112763307470e4254481a5680c6fdbff9 (diff) |
Fix T47534: Crash w/ project-paint from Python
Diffstat (limited to 'source/blender/editors/sculpt_paint/paint_stroke.c')
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_stroke.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_stroke.c b/source/blender/editors/sculpt_paint/paint_stroke.c index bf1a2fa57d7..31d4e6b809a 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; |