Sculpt-dev: add corruption check

Stopgap measure to deal with rare
PBVH corruption until I have the
time to properly track it down.
This commit is contained in:
Joseph Eagar 2021-11-14 01:10:02 -08:00
parent 2e782109fc
commit b633032711
1 changed files with 5 additions and 0 deletions

View File

@ -3598,6 +3598,11 @@ static void pbvh_bmesh_balance_tree(PBVH *pbvh)
printf("joined nodes; %d faces\n", BLI_array_len(faces));
for (int i = 0; i < BLI_array_len(faces); i++) {
if (BM_elem_is_free((BMElem*) faces[i], BM_FACE)) {
printf("corrupted face in pbvh tree; faces[i]: %p\n", faces[i]);
continue;
}
if (BM_ELEM_CD_GET_INT(faces[i], cd_face_node) != DYNTOPO_NODE_NONE) {
// printf("duplicate faces in pbvh_bmesh_balance_tree!\n");
continue;