[Bf-blender-cvs] [4dd6c9ad450] master: Fix T90236: Sculpt automasking failing when the stroke does not start over the mesh

Pablo Dobarro noreply at git.blender.org
Thu Aug 5 20:09:27 CEST 2021


Commit: 4dd6c9ad450f773a4bfaaad2d54feee815399ce4
Author: Pablo Dobarro
Date:   Tue Jul 27 20:50:26 2021 +0200
Branches: master
https://developer.blender.org/rB4dd6c9ad450f773a4bfaaad2d54feee815399ce4

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

===================================================================

M	source/blender/editors/sculpt_paint/sculpt.c

===================================================================

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;



More information about the Bf-blender-cvs mailing list