[Bf-blender-cvs] [44a386b88c2] blender-v2.83-release: Fix T75329: Missing show_face_sets checks for Multires
Pablo Dobarro
noreply at git.blender.org
Mon Apr 20 02:13:04 CEST 2020
Commit: 44a386b88c25d0c48c03d5b01863a398053b2283
Author: Pablo Dobarro
Date: Wed Apr 15 21:20:39 2020 +0200
Branches: blender-v2.83-release
https://developer.blender.org/rB44a386b88c25d0c48c03d5b01863a398053b2283
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
===================================================================
M source/blender/blenkernel/intern/paint.c
M source/blender/blenkernel/intern/pbvh.c
M source/blender/gpu/intern/gpu_buffers.c
===================================================================
diff --git a/source/blender/blenkernel/intern/paint.c b/source/blender/blenkernel/intern/paint.c
index d4408291712..4bbbae7081d 100644
--- a/source/blender/blenkernel/intern/paint.c
+++ b/source/blender/blenkernel/intern/paint.c
@@ -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;
}
diff --git a/source/blender/blenkernel/intern/pbvh.c b/source/blender/blenkernel/intern/pbvh.c
index 977e70745a3..33aa20fa1e4 100644
--- a/source/blender/blenkernel/intern/pbvh.c
+++ b/source/blender/blenkernel/intern/pbvh.c
@@ -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:
diff --git a/source/blender/gpu/intern/gpu_buffers.c b/source/blender/gpu/intern/gpu_buffers.c
index 8496bcac693..8b562413ce8 100644
--- a/source/blender/gpu/intern/gpu_buffers.c
+++ b/source/blender/gpu/intern/gpu_buffers.c
@@ -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]);
More information about the Bf-blender-cvs
mailing list