diff options
Diffstat (limited to 'source/blender/blenkernel/intern/pbvh.c')
-rw-r--r-- | source/blender/blenkernel/intern/pbvh.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/pbvh.c b/source/blender/blenkernel/intern/pbvh.c index 40974d7d4f8..c595ee56633 100644 --- a/source/blender/blenkernel/intern/pbvh.c +++ b/source/blender/blenkernel/intern/pbvh.c @@ -1925,5 +1925,20 @@ void pbvh_vertex_iter_init(PBVH *bvh, PBVHNode *node, void pbvh_show_diffuse_color_set(PBVH *bvh, bool show_diffuse_color) { - bvh->show_diffuse_color = show_diffuse_color; + bool has_mask = false; + + switch (bvh->type) { + case PBVH_GRIDS: + has_mask = (bvh->gridkey.has_mask != 0); + break; + case PBVH_FACES: + has_mask = (bvh->vdata && CustomData_get_layer(bvh->vdata, + CD_PAINT_MASK)); + break; + case PBVH_BMESH: + has_mask = (bvh->bm && (CustomData_get_offset(&bvh->bm->vdata, CD_PAINT_MASK) != -1)); + break; + } + + bvh->show_diffuse_color = !has_mask || show_diffuse_color; } |