From 0e9051fbfefbff8f043b98a4750a1e33ec0e85d8 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 1 Aug 2015 15:11:45 +1000 Subject: BMesh connect pair, fallback to identity matrix For overlapping vertices, a matrix for the operation can't be calculated. --- source/blender/bmesh/operators/bmo_connect_pair.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'source/blender/bmesh') diff --git a/source/blender/bmesh/operators/bmo_connect_pair.c b/source/blender/bmesh/operators/bmo_connect_pair.c index cf0e233fe6c..d5bc4db798c 100644 --- a/source/blender/bmesh/operators/bmo_connect_pair.c +++ b/source/blender/bmesh/operators/bmo_connect_pair.c @@ -556,7 +556,9 @@ void bmo_connect_vert_pair_exec(BMesh *bm, BMOperator *op) copy_v3_v3(pc.matrix[0], basis_tmp); copy_v3_v3(pc.matrix[1], basis_dir); copy_v3_v3(pc.matrix[2], basis_nor); - invert_m3(pc.matrix); + if (invert_m3(pc.matrix) == false) { + unit_m3(pc.matrix); + } pc.axis_sep = dot_m3_v3_row_x(pc.matrix, pc.v_a->co); } @@ -598,6 +600,11 @@ void bmo_connect_vert_pair_exec(BMesh *bm, BMOperator *op) else { /* didn't reach the end, remove it, * links are shared between states so just free the link_pool at the end */ + +#ifdef DEBUG_PRINT + printf("%s: state %p removed\n", __func__, state); +#endif + BLI_remlink(&pc.state_lb, state); MEM_freeN(state); } -- cgit v1.2.3