Fix T75329: Missing show_face_sets checks for Multires

These values were hardcoded before Face Sets were enabled for Multires,
so enable the show_face_sets checks now.

Reviewed By: jbakker

Maniphest Tasks: T75329

Differential Revision: https://developer.blender.org/D7444
This commit is contained in:
Pablo Dobarro 2020-04-15 21:20:39 +02:00
parent 65aaa13a00
commit 44a386b88c
Notes: blender-bot 2023-02-14 05:41:57 +01:00
Referenced by issue #75329, The display Face Sets toggle does not work with MultiRes and isolating sets at the lowest subdiv doesn't hide in the higher subdivs
3 changed files with 5 additions and 3 deletions

View File

@ -1854,7 +1854,7 @@ static PBVH *build_pbvh_from_ccg(Object *ob, SubdivCCG *subdiv_ccg)
subdiv_ccg->grid_flag_mats,
subdiv_ccg->grid_hidden);
pbvh_show_mask_set(pbvh, ob->sculpt->show_mask);
pbvh_show_face_sets_set(pbvh, false);
pbvh_show_face_sets_set(pbvh, ob->sculpt->show_face_sets);
return pbvh;
}

View File

@ -2958,7 +2958,7 @@ bool pbvh_has_face_sets(PBVH *bvh)
{
switch (bvh->type) {
case PBVH_GRIDS:
return false;
return (bvh->pdata && CustomData_get_layer(bvh->pdata, CD_SCULPT_FACE_SETS));
case PBVH_FACES:
return (bvh->pdata && CustomData_get_layer(bvh->pdata, CD_SCULPT_FACE_SETS));
case PBVH_BMESH:

View File

@ -691,6 +691,8 @@ void GPU_pbvh_grid_buffers_update(GPU_PBVH_Buffers *buffers,
{
const bool show_mask = (update_flags & GPU_PBVH_BUFFERS_SHOW_MASK) != 0;
const bool show_vcol = (update_flags & GPU_PBVH_BUFFERS_SHOW_VCOL) != 0;
const bool show_face_sets = sculpt_face_sets &&
(update_flags & GPU_PBVH_BUFFERS_SHOW_SCULPT_FACE_SETS) != 0;
bool empty_mask = true;
bool default_face_set = true;
@ -738,7 +740,7 @@ void GPU_pbvh_grid_buffers_update(GPU_PBVH_Buffers *buffers,
uchar face_set_color[4] = {UCHAR_MAX, UCHAR_MAX, UCHAR_MAX, UCHAR_MAX};
if (subdiv_ccg && sculpt_face_sets) {
if (show_face_sets && subdiv_ccg && sculpt_face_sets) {
const int face_index = BKE_subdiv_cgg_grid_to_face_index(subdiv_ccg, grid_index);
const int fset = abs(sculpt_face_sets[face_index]);