[Bf-blender-cvs] [aea8c0102ac] master: Fix T70140: Topology Automasking and 2D Falloff don't work correctly together

Pablo Dobarro noreply at git.blender.org
Tue Sep 24 15:50:02 CEST 2019


Commit: aea8c0102ac79b04147458ff07a0886b87396b30
Author: Pablo Dobarro
Date:   Mon Sep 23 23:06:11 2019 +0200
Branches: master
https://developer.blender.org/rBaea8c0102ac79b04147458ff07a0886b87396b30

Fix T70140: Topology Automasking and 2D Falloff don't work correctly together

Reviewed By: jbakker

Maniphest Tasks: T70140

Differential Revision: https://developer.blender.org/D5878

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

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

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

diff --git a/source/blender/editors/sculpt_paint/paint_cursor.c b/source/blender/editors/sculpt_paint/paint_cursor.c
index 523469912e1..466615f4a94 100644
--- a/source/blender/editors/sculpt_paint/paint_cursor.c
+++ b/source/blender/editors/sculpt_paint/paint_cursor.c
@@ -1349,6 +1349,17 @@ static void paint_draw_cursor(bContext *C, int x, int y, void *UNUSED(unused))
     /* Only sculpt mode cursor for now */
     /* Disable for PBVH_GRIDS */
     bool is_multires = ss && ss->pbvh && BKE_pbvh_type(ss->pbvh) == PBVH_GRIDS;
+
+    SculptCursorGeometryInfo gi;
+    float mouse[2] = {x - ar->winrct.xmin, y - ar->winrct.ymin};
+    bool is_cursor_over_mesh = false;
+
+    /* Update the active vertex */
+    if ((mode == PAINT_MODE_SCULPT) && !ups->stroke_active) {
+      is_cursor_over_mesh = sculpt_cursor_geometry_info_update(
+          C, &gi, mouse, !(brush->falloff_shape & BRUSH_AIRBRUSH));
+    }
+
     if ((mode == PAINT_MODE_SCULPT) && ss && !is_multires &&
         !(brush->falloff_shape & BRUSH_AIRBRUSH)) {
       Sculpt *sd = CTX_data_tool_settings(C)->sculpt;
@@ -1363,11 +1374,9 @@ static void paint_draw_cursor(bContext *C, int x, int y, void *UNUSED(unused))
       }
 
       if (!ups->stroke_active) {
-        SculptCursorGeometryInfo gi;
-        float mouse[2] = {x - ar->winrct.xmin, y - ar->winrct.ymin};
         int prev_active_vertex_index = ss->active_vertex_index;
         bool update_previews = false;
-        if (sculpt_cursor_geometry_info_update(C, &gi, mouse, true) && !alpha_overlay_active) {
+        if (is_cursor_over_mesh && !alpha_overlay_active) {
 
           if (prev_active_vertex_index != ss->active_vertex_index) {
             update_previews = true;
diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c
index f31c2db9191..bf194a8c867 100644
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@ -1131,6 +1131,11 @@ static void sculpt_automasking_end(Object *ob)
 
 static bool sculpt_automasking_is_constrained_by_radius(Brush *br)
 {
+  /* 2D falloff is not constrained by radius */
+  if (br->falloff_shape & BRUSH_AIRBRUSH) {
+    return false;
+  }
+
   if (ELEM(br->sculpt_tool, SCULPT_TOOL_GRAB, SCULPT_TOOL_THUMB)) {
     return true;
   }



More information about the Bf-blender-cvs mailing list