diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2013-11-11 18:29:01 +0400 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2013-11-11 18:29:01 +0400 |
commit | 7fc1088164303df0807fd78ccffbd0ec8a12a09e (patch) | |
tree | 90b4cea40e032780e46fd97c09d616bae15fc2ed /source/blender/bmesh/operators | |
parent | 39673718864f018307e49fac62696341b3230628 (diff) |
Fix [#37388] Grid fill crashes blender in specific situation.
With some geometries, we can have a valid first path, without being able to find a valid second one, added needed check.
Diffstat (limited to 'source/blender/bmesh/operators')
-rw-r--r-- | source/blender/bmesh/operators/bmo_fill_grid.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/source/blender/bmesh/operators/bmo_fill_grid.c b/source/blender/bmesh/operators/bmo_fill_grid.c index 4e302a8ff63..50d25202f7e 100644 --- a/source/blender/bmesh/operators/bmo_fill_grid.c +++ b/source/blender/bmesh/operators/bmo_fill_grid.c @@ -633,7 +633,12 @@ void bmo_grid_fill_exec(BMesh *bm, BMOperator *op) goto cleanup; } - BM_mesh_edgeloops_find_path(bm, &eloops_rail, bm_edge_test_rail_cb, (void *)bm, v_a_first, v_b_last); + /* We may find a first path, but not a second one! See geometry attached to bug [#37388]. */ + if (BM_mesh_edgeloops_find_path(bm, &eloops_rail, bm_edge_test_rail_cb, bm, v_a_first, v_b_last) == false) { + BMO_error_raise(bm, op, BMERR_INVALID_SELECTION, + "Loops are not connected by wire/boundary edges"); + goto cleanup; + } /* Check flipping by comparing path length */ estore_rail_a = eloops_rail.first; @@ -656,7 +661,7 @@ void bmo_grid_fill_exec(BMesh *bm, BMOperator *op) BM_edgeloop_free(estore_rail_a); estore_rail_a = estore_rail_b; - /* reverse so these so both are sorted the same way */ + /* reverse so both are sorted the same way */ BM_edgeloop_flip(bm, estore_b); SWAP(BMVert *, v_b_first, v_b_last); |