From 229b9f1299c6739db5c08ce84127e6390c3041ed Mon Sep 17 00:00:00 2001 From: Pablo Dobarro Date: Mon, 12 Oct 2020 20:32:26 +0200 Subject: 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 --- source/blender/makesrna/intern/rna_brush.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source/blender/makesrna') diff --git a/source/blender/makesrna/intern/rna_brush.c b/source/blender/makesrna/intern/rna_brush.c index eed278c3980..ac876eac7db 100644 --- a/source/blender/makesrna/intern/rna_brush.c +++ b/source/blender/makesrna/intern/rna_brush.c @@ -3426,6 +3426,11 @@ static void rna_def_operator_stroke_element(BlenderRNA *brna) RNA_def_property_array(prop, 2); RNA_def_property_ui_text(prop, "Mouse", ""); + prop = RNA_def_property(srna, "mouse_event", PROP_FLOAT, PROP_XYZ); + RNA_def_property_flag(prop, PROP_IDPROPERTY); + RNA_def_property_array(prop, 2); + RNA_def_property_ui_text(prop, "Mouse Event", ""); + prop = RNA_def_property(srna, "pressure", PROP_FLOAT, PROP_FACTOR); RNA_def_property_flag(prop, PROP_IDPROPERTY); RNA_def_property_range(prop, 0.0f, 1.0f); -- cgit v1.2.3