From 4dd6c9ad450f773a4bfaaad2d54feee815399ce4 Mon Sep 17 00:00:00 2001 From: Pablo Dobarro Date: Tue, 27 Jul 2021 20:50:26 +0200 Subject: Fix T90236: Sculpt automasking failing when the stroke does not start over the mesh The active geometry element are usually updated by the cursor drawing code (as they are needed for the cursor preview) and when an sculpt operator starts. For brushes, this was not happening. This was making brushes rely by default on the last cursor drawing update, which can be incorrect if the mouse moved after starting the stroke without hovering the active geometry. Reviewed By: JacquesLucke Maniphest Tasks: T90236 Differential Revision: https://developer.blender.org/D12045 --- source/blender/editors/sculpt_paint/sculpt.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source/blender/editors') diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index 83388c1aef2..8264affc465 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -7887,6 +7887,9 @@ static bool sculpt_stroke_test_start(bContext *C, struct wmOperator *op, const f sculpt_update_cache_invariants(C, sd, ss, op, mouse); + SculptCursorGeometryInfo sgi; + SCULPT_cursor_geometry_info_update(C, &sgi, mouse, false); + SCULPT_undo_push_begin(ob, sculpt_tool_name(sd)); return true; -- cgit v1.2.3