diff options
-rw-r--r-- | source/blender/blenkernel/BKE_pbvh.h | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/pbvh_bmesh.c | 11 | ||||
-rw-r--r-- | source/blender/editors/sculpt_paint/sculpt.c | 2 |
3 files changed, 8 insertions, 7 deletions
diff --git a/source/blender/blenkernel/BKE_pbvh.h b/source/blender/blenkernel/BKE_pbvh.h index 13adb868c01..570203081fe 100644 --- a/source/blender/blenkernel/BKE_pbvh.h +++ b/source/blender/blenkernel/BKE_pbvh.h @@ -280,7 +280,7 @@ bool BKE_pbvh_node_frustum_exclude_AABB(PBVHNode *node, void *frustum); struct GSet *BKE_pbvh_bmesh_node_unique_verts(PBVHNode *node); struct GSet *BKE_pbvh_bmesh_node_other_verts(PBVHNode *node); struct GSet *BKE_pbvh_bmesh_node_faces(PBVHNode *node); -void BKE_pbvh_bmesh_node_save_orig(PBVHNode *node); +void BKE_pbvh_bmesh_node_save_orig(struct BMesh *bm, PBVHNode *node); void BKE_pbvh_bmesh_after_stroke(PBVH *bvh); /* Update Bounding Box/Redraw and clear flags */ diff --git a/source/blender/blenkernel/intern/pbvh_bmesh.c b/source/blender/blenkernel/intern/pbvh_bmesh.c index 6d38ae13994..d4115dc0080 100644 --- a/source/blender/blenkernel/intern/pbvh_bmesh.c +++ b/source/blender/blenkernel/intern/pbvh_bmesh.c @@ -413,7 +413,7 @@ static bool pbvh_bmesh_node_limit_ensure(PBVH *bvh, int node_index) /* so we can do direct lookups on 'bbc_array' */ BM_elem_index_set(f, i); /* set_dirty! */ } - /* likely this is already dirty */ + /* Likely this is already dirty. */ bvh->bm->elem_index_dirty |= BM_FACE; pbvh_bmesh_node_split(bvh, bbc_array, node_index); @@ -1923,15 +1923,14 @@ void BKE_pbvh_build_bmesh(PBVH *bvh, nodeinfo[i] = f; BM_ELEM_CD_SET_INT(f, cd_face_node_offset, DYNTOPO_NODE_NONE); } + /* Likely this is already dirty. */ + bm->elem_index_dirty |= BM_FACE; BMVert *v; BM_ITER_MESH (v, &iter, bm, BM_VERTS_OF_MESH) { BM_ELEM_CD_SET_INT(v, cd_vert_node_offset, DYNTOPO_NODE_NONE); } - /* likely this is already dirty */ - bm->elem_index_dirty |= BM_FACE; - /* setup root node */ struct FastNodeBuildInfo rootnode = {0}; rootnode.totface = bm->totface; @@ -2036,7 +2035,7 @@ bool BKE_pbvh_bmesh_update_topology(PBVH *bvh, * (currently just raycast), store the node's triangles and vertices. * * Skips triangles that are hidden. */ -void BKE_pbvh_bmesh_node_save_orig(PBVHNode *node) +void BKE_pbvh_bmesh_node_save_orig(BMesh *bm, PBVHNode *node) { /* Skip if original coords/triangles are already saved */ if (node->bm_orco) { @@ -2065,6 +2064,8 @@ void BKE_pbvh_bmesh_node_save_orig(PBVHNode *node) BM_elem_index_set(v, i); /* set_dirty! */ i++; } + /* Likely this is already dirty. */ + bm->elem_index_dirty |= BM_VERT; /* Copy the triangles */ i = 0; diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index 06fa03ccbc6..43f1bbb33f3 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -5211,7 +5211,7 @@ static void sculpt_topology_update(Sculpt *sd, if (BKE_pbvh_type(ss->pbvh) == PBVH_BMESH) { BKE_pbvh_node_mark_topology_update(nodes[n]); - BKE_pbvh_bmesh_node_save_orig(nodes[n]); + BKE_pbvh_bmesh_node_save_orig(ss->bm, nodes[n]); } } |