From ee23f0f3fb58ce569947171d8f9dff97ec564c27 Mon Sep 17 00:00:00 2001 From: Hans Goudey Date: Wed, 14 Sep 2022 14:33:55 -0500 Subject: Sculpt: Separate hide status from face sets, use generic attribute Whether faces are hidden and face sets are orthogonal concepts, but currently sculpt mode stores them together in the face set array. This means that if anything is hidden, there must be face sets, and if there are face sets, we have to keep track of what is hidden. In other words, it adds a bunch of redundant work and state tracking. On the user level it's nice that face sets and hiding are consistent, but we don't need to store them together to accomplish that. This commit uses the `".hide_poly"` attribute from rB2480b55f216c to read and change hiding in sculpt mode. Face sets don't need to be negative anymore, and a bunch of "face set <-> hide status" conversion can be removed. Plus some other benefits: - We don't need to allocate either array quite as much. - The hide status can be read from 1/4 the memory as face sets. - Updates when entering or exiting sculpt mode can be removed. - More opportunities for early-outs when nothing is hidden. - Separating concerns makes sculpt code more obvious. - It will be easier to convert face sets into a generic int attribute. Differential Revision: https://developer.blender.org/D15950 --- source/blender/editors/sculpt_paint/paint_hide.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'source/blender/editors/sculpt_paint/paint_hide.c') diff --git a/source/blender/editors/sculpt_paint/paint_hide.c b/source/blender/editors/sculpt_paint/paint_hide.c index 2b80c62a0ba..9e435ee0748 100644 --- a/source/blender/editors/sculpt_paint/paint_hide.c +++ b/source/blender/editors/sculpt_paint/paint_hide.c @@ -386,8 +386,6 @@ static int hide_show_exec(bContext *C, wmOperator *op) BKE_pbvh_update_hide_attributes_from_mesh(pbvh); } - SCULPT_visibility_sync_all_vertex_to_face_sets(ob->sculpt); - DEG_id_tag_update(&ob->id, ID_RECALC_SHADING); ED_region_tag_redraw(region); -- cgit v1.2.3