diff options
author | Nicholas Bishop <nicholasbishop@gmail.com> | 2013-01-26 21:19:21 +0400 |
---|---|---|
committer | Nicholas Bishop <nicholasbishop@gmail.com> | 2013-01-26 21:19:21 +0400 |
commit | 7e49a39acda5cdc86ce87470f7dc10cd80f1eba7 (patch) | |
tree | cf1d5ad0a6617acf7d9ced18ec3c1a942638e8c7 | |
parent | 4245a107cf7d471322be7013855683573a9fd6ad (diff) |
Check for deletion before moving vert in dyntopo collapse edge
Fixes [#33964] Dyntopo crash with edge collapse + undo
projects.blender.org/tracker/?func=detail&aid=33964&group_id=9&atid=498
-rw-r--r-- | source/blender/blenkernel/intern/pbvh_bmesh.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/pbvh_bmesh.c b/source/blender/blenkernel/intern/pbvh_bmesh.c index c464de64c6a..9a0b1a76988 100644 --- a/source/blender/blenkernel/intern/pbvh_bmesh.c +++ b/source/blender/blenkernel/intern/pbvh_bmesh.c @@ -857,9 +857,12 @@ static void pbvh_bmesh_collapse_edge(PBVH *bvh, BMEdge *e, BMVert *v1, } } - /* Move v1 to the midpoint of v1 and v2 */ - BM_log_vert_before_modified(bvh->bm, bvh->bm_log, v1); - mid_v3_v3v3(v1->co, v1->co, v2->co); + /* Move v1 to the midpoint of v1 and v2 (if v1 still exists, it + * may have been deleted above) */ + if (!BLI_ghash_haskey(deleted_verts, v1)) { + BM_log_vert_before_modified(bvh->bm, bvh->bm_log, v1); + mid_v3_v3v3(v1->co, v1->co, v2->co); + } /* Delete v2 */ BLI_assert(BM_vert_face_count(v2) == 0); |