diff options
author | Joseph Eagar <joeedh@gmail.com> | 2022-05-30 12:48:04 +0300 |
---|---|---|
committer | Joseph Eagar <joeedh@gmail.com> | 2022-05-30 12:48:04 +0300 |
commit | f1c29b9bd3c8241b212d7d50b2d538b980a7d62e (patch) | |
tree | 6fbf918bfae4f867270ec88aed0988e744f99e43 /source | |
parent | a7bda30ca890d1a76b1a1f0be23cb08a4bd1b5f5 (diff) |
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.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/sculpt_paint/sculpt.c | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index 85ea5d5bfc6..34647cd9bf6 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -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) |