From efe0e2b18370972c14383e809719c2b606abc414 Mon Sep 17 00:00:00 2001 From: Hans Goudey Date: Tue, 2 Aug 2022 11:00:38 -0500 Subject: Fix T96810: Invalid sculpt normals after some operations Mask and color brushes were using the existing PBVH vertex "update tag" to mark their modifications. This was mostly unnecessary, and causes unnecessary calculation of normals. It also caused errors though, because they didn't tag the corresponding PBVH node for normal recalculation, causing problems on the borders of nodes, since one node might accumulate into another's vertex normals, but the other node wouldn't also accumulate and normalize the normals. The solution is to only use the update tag for tagging deformed vertices that need recalculated normals. Everything else is handled at the PBVH node level (which was already the case, but it wasn't clear). The update tag was also used for undo to tag the nodes corresponding to changed vertices. This was wrong though, because normals and visibility would also be recalculated for just color or mask undo steps. Instead, just use local arrays to map from vertices to nodes. Differential Revision: https://developer.blender.org/D15581 --- source/blender/editors/sculpt_paint/sculpt_filter_color.c | 4 ---- 1 file changed, 4 deletions(-) (limited to 'source/blender/editors/sculpt_paint/sculpt_filter_color.c') diff --git a/source/blender/editors/sculpt_paint/sculpt_filter_color.c b/source/blender/editors/sculpt_paint/sculpt_filter_color.c index a9186010a9f..27092bf9a04 100644 --- a/source/blender/editors/sculpt_paint/sculpt_filter_color.c +++ b/source/blender/editors/sculpt_paint/sculpt_filter_color.c @@ -225,10 +225,6 @@ static void color_filter_task_cb(void *__restrict userdata, } SCULPT_vertex_color_set(ss, vd.index, final_color); - - if (vd.mvert) { - BKE_pbvh_vert_mark_update(ss->pbvh, vd.index); - } } BKE_pbvh_vertex_iter_end; BKE_pbvh_node_mark_update_color(data->nodes[n]); -- cgit v1.2.3