From 8442b0ffc1df59cf6e557e7243b9197b2a898aa0 Mon Sep 17 00:00:00 2001 From: Hans Goudey Date: Tue, 13 Sep 2022 08:35:48 -0500 Subject: Fix T101027: Sculpt tools don't respect visibility after recent commit Caused by b5f7af31d6d4, which exposed the fact that the PBVH wasn't retrieving the updated hide status attributes if they were allocated in sculpt mode. Previously the attributes were always allocated when entering sculpt mode. --- source/blender/blenkernel/intern/pbvh.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'source/blender/blenkernel/intern') diff --git a/source/blender/blenkernel/intern/pbvh.c b/source/blender/blenkernel/intern/pbvh.c index 2de5c718918..2e273e076d5 100644 --- a/source/blender/blenkernel/intern/pbvh.c +++ b/source/blender/blenkernel/intern/pbvh.c @@ -3247,6 +3247,14 @@ void BKE_pbvh_face_sets_set(PBVH *pbvh, int *face_sets) pbvh->face_sets = face_sets; } +void BKE_pbvh_update_hide_attributes_from_mesh(PBVH *pbvh) +{ + if (pbvh->header.type == PBVH_FACES) { + pbvh->hide_vert = CustomData_get_layer_named(&pbvh->mesh->vdata, CD_PROP_BOOL, ".hide_vert"); + pbvh->hide_poly = CustomData_get_layer_named(&pbvh->mesh->pdata, CD_PROP_BOOL, ".hide_poly"); + } +} + void BKE_pbvh_respect_hide_set(PBVH *pbvh, bool respect_hide) { pbvh->respect_hide = respect_hide; -- cgit v1.2.3