Fix T98368: Shading artifacts on paint/mask anchored sculpt brushes

I'm not sure what is causing this.  Vertex normals get corrupted
for paint and mask sculpt brushes but not the normal geometric
ones.  Since we don't actually need to recalculate normals
here to begin with I've just disabled it.  The code now
calls the appropriate node mark update function based on
the sculpt tool.
This commit is contained in:
Joseph Eagar 2022-05-30 02:48:04 -07:00
parent a7bda30ca8
commit f1c29b9bd3
Notes: blender-bot 2023-02-14 08:42:54 +01:00
Referenced by issue #98368, Sculpt Paint: Smooth shading glitches with textured anchored strokes
4 changed files with 20 additions and 7 deletions

@ -1 +1 @@
Subproject commit 647c85462d87c3a9d3a189d28d72d1bd93f4d4a8
Subproject commit ebc3989630d18afe00624fc5e4bae6cc0de7a260

@ -1 +1 @@
Subproject commit d936e4c01fa263a71a7d0665628ae621283b15ee
Subproject commit 1c8e7f124d17b64ff05cbe179264ba7c7c3aa9fc

@ -1 +1 @@
Subproject commit 61e45814503f51963c91c51aaf764612e7c5dc72
Subproject commit 61efd17f87b45c3049091127a5619219f9d2a821

View File

@ -1354,8 +1354,23 @@ static void paint_mesh_restore_co_task_cb(void *__restrict userdata,
SculptSession *ss = data->ob->sculpt;
SculptUndoNode *unode;
SculptUndoType type = (data->brush->sculpt_tool == SCULPT_TOOL_MASK ? SCULPT_UNDO_MASK :
SCULPT_UNDO_COORDS);
SculptUndoType type;
switch (data->brush->sculpt_tool) {
case SCULPT_TOOL_MASK:
type = SCULPT_UNDO_MASK;
BKE_pbvh_node_mark_update_mask(data->nodes[n]);
break;
case SCULPT_TOOL_PAINT:
case SCULPT_TOOL_SMEAR:
type = SCULPT_UNDO_COLOR;
BKE_pbvh_node_mark_update_color(data->nodes[n]);
break;
default:
type = SCULPT_UNDO_COORDS;
BKE_pbvh_node_mark_update(data->nodes[n]);
break;
}
if (ss->bm) {
unode = SCULPT_undo_push_node(data->ob, data->nodes[n], type);
@ -1397,8 +1412,6 @@ static void paint_mesh_restore_co_task_cb(void *__restrict userdata,
}
}
BKE_pbvh_vertex_iter_end;
BKE_pbvh_node_mark_update(data->nodes[n]);
}
static void paint_mesh_restore_co(Sculpt *sd, Object *ob)