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/sculpt_intern.h
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/sculpt_intern.h')
-rw-r--r--source/blender/editors/sculpt_paint/sculpt_intern.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/source/blender/editors/sculpt_paint/sculpt_intern.h b/source/blender/editors/sculpt_paint/sculpt_intern.h
index ec4d594293a..916e7336c37 100644
--- a/source/blender/editors/sculpt_paint/sculpt_intern.h
+++ b/source/blender/editors/sculpt_paint/sculpt_intern.h
@@ -868,12 +868,17 @@ typedef struct StrokeCache {
bool pen_flip;
bool invert;
float pressure;
- float mouse[2];
float bstrength;
float normal_weight; /* from brush (with optional override) */
float x_tilt;
float y_tilt;
+ /* Position of the mouse corresponding to the stroke location, modified by the paint_stroke
+ * operator acording to the stroke type. */
+ float mouse[2];
+ /* Position of the mouse event in screen space, not modified by the stroke type. */
+ float mouse_event[2];
+
float (*prev_colors)[4];
/* The rest is temporary storage that isn't saved as a property */