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
diff options
context:
space:
mode:
authorPablo Dobarro <pablodp606@gmail.com>2020-10-12 21:32:26 +0300
committerPablo Dobarro <pablodp606@gmail.com>2020-10-15 20:45:43 +0300
commit229b9f1299c6739db5c08ce84127e6390c3041ed (patch)
treec5bd322b593df6d50168070dfe67b269bca0fe94 /source/blender/editors/sculpt_paint/paint_stroke.c
parent6991b13e41f39e07e1d6bf4a3ae95249e610afb8 (diff)
Fix brush tip delta orientation with anchored strokes
When using anchored stroke, the stroke operator was modifying the coordinates on the "mouse" rna property by setting them to the original position. Because of this, all the sculpt delta calculation was failing and the delta for these brushes was set randomly (with a 0 vector) at the beginning of the stroke. There is now an extra property that uses the unmodified coordinates of the mouse to calculate the delta. Now delta orientation works as expected in all brushes and features that require brush tip orientation. Reviewed By: sergey Differential Revision: https://developer.blender.org/D9183
Diffstat (limited to 'source/blender/editors/sculpt_paint/paint_stroke.c')
-rw-r--r--source/blender/editors/sculpt_paint/paint_stroke.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_stroke.c b/source/blender/editors/sculpt_paint/paint_stroke.c
index da0a8dbd4b8..0da0b191537 100644
--- a/source/blender/editors/sculpt_paint/paint_stroke.c
+++ b/source/blender/editors/sculpt_paint/paint_stroke.c
@@ -621,7 +621,10 @@ static void paint_brush_stroke_add_step(bContext *C,
RNA_collection_add(op->ptr, "stroke", &itemptr);
RNA_float_set(&itemptr, "size", ups->pixel_radius);
RNA_float_set_array(&itemptr, "location", location);
+ /* Mouse coordinates modified by the stroke type options. */
RNA_float_set_array(&itemptr, "mouse", mouse_out);
+ /* Original mouse coordinates. */
+ RNA_float_set_array(&itemptr, "mouse_event", mouse_in);
RNA_boolean_set(&itemptr, "pen_flip", stroke->pen_flip);
RNA_float_set(&itemptr, "pressure", pressure);
RNA_float_set(&itemptr, "x_tilt", stroke->x_tilt);