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
This commit is contained in:
parent
a9d3e95bea
commit
aea8c0102a
Notes:
blender-bot
2023-02-14 02:22:07 +01:00
Referenced by commit d6dcf5b1ff
, Sculpt: Fix crash hovering mouse onto multire surface
Referenced by issue #70140, Topology Automasking and 2D Falloff don't work correctly together
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue