diff options
author | Pablo Dobarro <pablodp606@gmail.com> | 2019-09-24 00:06:11 +0300 |
---|---|---|
committer | Pablo Dobarro <pablodp606@gmail.com> | 2019-09-24 16:51:47 +0300 |
commit | aea8c0102ac79b04147458ff07a0886b87396b30 (patch) | |
tree | 44261df1ef615ae5930fd78d50a5d9ec36effb37 /source/blender/editors | |
parent | a9d3e95bea0c7b6e0577d38eea841b3886df814f (diff) |
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
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_cursor.c | 15 | ||||
-rw-r--r-- | source/blender/editors/sculpt_paint/sculpt.c | 5 |
2 files changed, 17 insertions, 3 deletions
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; } |