diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2014-05-22 00:35:08 +0400 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2014-05-22 00:37:50 +0400 |
commit | a217db0d6373a4050658049a9ded84f34b33f952 (patch) | |
tree | 18a2c2befaaf38f0d4ab40e1a8b96a45e71bf067 /source/blender/bmesh/operators | |
parent | 8d297394ba51246f2db0d503df7f4cae19ca6e92 (diff) |
Fix T40297: Crash while ripping an edge when autosmooth is activated.
Turned out there was still quite a few cases were indices were set dirty,
but elem_index_dirty was not tagged accordingly (mostly for BM_LOOP,
but a few others as well). So probably this crash was not the only one
hidden here.
Hopefully all possible cases were catched this time!
Diffstat (limited to 'source/blender/bmesh/operators')
-rw-r--r-- | source/blender/bmesh/operators/bmo_connect.c | 2 | ||||
-rw-r--r-- | source/blender/bmesh/operators/bmo_connect_nonplanar.c | 6 | ||||
-rw-r--r-- | source/blender/bmesh/operators/bmo_inset.c | 3 | ||||
-rw-r--r-- | source/blender/bmesh/operators/bmo_subdivide.c | 2 |
4 files changed, 7 insertions, 6 deletions
diff --git a/source/blender/bmesh/operators/bmo_connect.c b/source/blender/bmesh/operators/bmo_connect.c index c98777d87a8..5a00401b3c7 100644 --- a/source/blender/bmesh/operators/bmo_connect.c +++ b/source/blender/bmesh/operators/bmo_connect.c @@ -86,7 +86,7 @@ static int bm_face_connect_verts(BMesh *bm, BMFace *f, const bool check_degenera } if (check_degenerate) { - BM_face_splits_check_legal(f, loops_split, STACK_SIZE(loops_split)); + BM_face_splits_check_legal(bm, f, loops_split, STACK_SIZE(loops_split)); } else { BM_face_splits_check_optimal(f, loops_split, STACK_SIZE(loops_split)); diff --git a/source/blender/bmesh/operators/bmo_connect_nonplanar.c b/source/blender/bmesh/operators/bmo_connect_nonplanar.c index be325fc9adc..6859ce2060c 100644 --- a/source/blender/bmesh/operators/bmo_connect_nonplanar.c +++ b/source/blender/bmesh/operators/bmo_connect_nonplanar.c @@ -63,7 +63,7 @@ static float bm_face_subset_calc_planar(BMLoop *l_first, BMLoop *l_last, const f return delta_z; } -static bool bm_face_split_find(BMFace *f, BMLoop *l_pair[2], float *r_angle) +static bool bm_face_split_find(BMesh *bm, BMFace *f, BMLoop *l_pair[2], float *r_angle) { BMLoop *l_iter, *l_first; BMLoop **l_arr = BLI_array_alloca(l_arr, f->len); @@ -102,7 +102,7 @@ static bool bm_face_split_find(BMFace *f, BMLoop *l_pair[2], float *r_angle) if (err_test < err_best) { /* check we're legal (we could batch this) */ BMLoop *l_split[2] = {l_a, l_b}; - BM_face_splits_check_legal(f, &l_split, 1); + BM_face_splits_check_legal(bm, f, &l_split, 1); if (l_split[0]) { err_best = err_test; l_pair[0] = l_a; @@ -129,7 +129,7 @@ static bool bm_face_split_by_angle(BMesh *bm, BMFace *f, BMFace *r_f_pair[2], co BMLoop *l_pair[2]; float angle; - if (bm_face_split_find(f, l_pair, &angle) && (angle > angle_limit)) { + if (bm_face_split_find(bm, f, l_pair, &angle) && (angle > angle_limit)) { BMFace *f_new; BMLoop *l_new; diff --git a/source/blender/bmesh/operators/bmo_inset.c b/source/blender/bmesh/operators/bmo_inset.c index cb4255d337e..0ca4ddf8d55 100644 --- a/source/blender/bmesh/operators/bmo_inset.c +++ b/source/blender/bmesh/operators/bmo_inset.c @@ -90,8 +90,9 @@ static void bm_interp_face_store(InterpFace *iface, BMesh *bm, BMFace *f, MemAre CustomData_bmesh_copy_data(&bm->vdata, &bm->vdata, l_iter->v->head.data, &blocks_v[i]); /* use later for index lookups */ - BM_elem_index_set(l_iter, i); /* set_ok */ + BM_elem_index_set(l_iter, i); /* set_dirty */ } while (i++, (l_iter = l_iter->next) != l_first); + bm->elem_index_dirty |= BM_LOOP; } static void bm_interp_face_free(InterpFace *iface, BMesh *bm) { diff --git a/source/blender/bmesh/operators/bmo_subdivide.c b/source/blender/bmesh/operators/bmo_subdivide.c index c9b35e895aa..0730c287eaa 100644 --- a/source/blender/bmesh/operators/bmo_subdivide.c +++ b/source/blender/bmesh/operators/bmo_subdivide.c @@ -1113,7 +1113,7 @@ void bmo_subdivide_edges_exec(BMesh *bm, BMOperator *op) * - concave corner of an ngon. * - 2 edges being used in 2+ ngons. */ -// BM_face_splits_check_legal(face, loops_split, BLI_array_count(loops_split)); +// BM_face_splits_check_legal(bm, face, loops_split, BLI_array_count(loops_split)); for (j = 0; j < BLI_array_count(loops_split); j++) { if (loops_split[j][0]) { |