From ff1e337bb47ce801e99afeec3d5ccdab5a5a3212 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Thu, 8 Nov 2012 14:22:05 +0000 Subject: [PATCH] Correction to previous commit pBVH nodes buffers could share some pointers from pBVH itself, and after updating pointers in pBVH we need to recreate this buffers. This starts looking a bit awkward and seems it's mainly because of assumptions made when was working on sculpting on deformed mesh. Would revision such a sculpting and would try to make it more clear later. --- source/blender/blenlib/intern/pbvh.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/source/blender/blenlib/intern/pbvh.c b/source/blender/blenlib/intern/pbvh.c index 8e9f0bfef10..e21ce0716d2 100644 --- a/source/blender/blenlib/intern/pbvh.c +++ b/source/blender/blenlib/intern/pbvh.c @@ -1710,11 +1710,16 @@ void BLI_pbvh_draw(PBVH *bvh, float (*planes)[4], float (*face_nors)[3], void BLI_pbvh_grids_update(PBVH *bvh, CCGElem **grids, DMGridAdjacency *gridadj, void **gridfaces, DMFlagMat *flagmats, BLI_bitmap *grid_hidden) { + int a; + bvh->grids = grids; bvh->gridadj = gridadj; bvh->gridfaces = gridfaces; bvh->grid_flag_mats = flagmats; bvh->grid_hidden = grid_hidden; + + for (a = 0; a < bvh->totnode; ++a) + BLI_pbvh_node_mark_rebuild_draw(&bvh->nodes[a]); } float (*BLI_pbvh_get_vertCos(PBVH * pbvh))[3]