[Bf-blender-cvs] [b88421a] master: Dyntopo: avoid redundant loop collapsing edges
Campbell Barton
noreply at git.blender.org
Thu Apr 16 04:27:40 CEST 2015
Commit: b88421aa6204f51e23dbff3ee48a5d2c360b0536
Author: Campbell Barton
Date: Thu Apr 16 12:24:59 2015 +1000
Branches: master
https://developer.blender.org/rBb88421aa6204f51e23dbff3ee48a5d2c360b0536
Dyntopo: avoid redundant loop collapsing edges
===================================================================
M source/blender/blenkernel/intern/pbvh_bmesh.c
===================================================================
diff --git a/source/blender/blenkernel/intern/pbvh_bmesh.c b/source/blender/blenkernel/intern/pbvh_bmesh.c
index 116c182..d54c598 100644
--- a/source/blender/blenkernel/intern/pbvh_bmesh.c
+++ b/source/blender/blenkernel/intern/pbvh_bmesh.c
@@ -1160,18 +1160,6 @@ static void pbvh_bmesh_collapse_edge(
v_tri[1] = l_iter->v; e_tri[1] = l_iter->e; l_iter = l_iter->next;
v_tri[2] = l_iter->v; e_tri[2] = l_iter->e;
- /* Check if any of the face's vertices are now unused, if so
- * remove them from the PBVH */
- for (j = 0; j < 3; j++) {
- if (v_tri[j] != v_del && BM_vert_face_count_is_equal(v_tri[j], 1)) {
- BLI_gset_insert(deleted_verts, v_tri[j]);
- pbvh_bmesh_vert_remove(bvh, v_tri[j]);
- }
- else {
- v_tri[j] = NULL;
- }
- }
-
/* Remove the face */
pbvh_bmesh_face_remove(bvh, f_del);
BM_face_kill(bvh->bm, f_del);
@@ -1183,9 +1171,13 @@ static void pbvh_bmesh_collapse_edge(
BM_edge_kill(bvh->bm, e_tri[j]);
}
- /* Delete unused vertices */
+ /* Check if any of the face's vertices are now unused, if so
+ * remove them from the PBVH */
for (j = 0; j < 3; j++) {
- if (v_tri[j]) {
+ if ((v_tri[j] != v_del) && (v_tri[j]->e == NULL)) {
+ BLI_gset_insert(deleted_verts, v_tri[j]);
+ pbvh_bmesh_vert_remove(bvh, v_tri[j]);
+
BM_log_vert_removed(bvh->bm_log, v_tri[j], eq_ctx->cd_vert_mask_offset);
BM_vert_kill(bvh->bm, v_tri[j]);
}
More information about the Bf-blender-cvs
mailing list