[Bf-blender-cvs] [dec523d] master: Fix for regression in bmesh connect-pair

Campbell Barton noreply at git.blender.org
Sat Jan 10 02:40:26 CET 2015


Commit: dec523da877facb0573dccce6d95e5b0d2734707
Author: Campbell Barton
Date:   Sat Jan 10 12:20:17 2015 +1100
Branches: master
https://developer.blender.org/rBdec523da877facb0573dccce6d95e5b0d2734707

Fix for regression in bmesh connect-pair

T42563 fix wasn't right, fortunately this doesn't fail in most cases.

===================================================================

M	source/blender/bmesh/operators/bmo_connect_pair.c

===================================================================

diff --git a/source/blender/bmesh/operators/bmo_connect_pair.c b/source/blender/bmesh/operators/bmo_connect_pair.c
index b82823e..9db87dd 100644
--- a/source/blender/bmesh/operators/bmo_connect_pair.c
+++ b/source/blender/bmesh/operators/bmo_connect_pair.c
@@ -464,19 +464,23 @@ void bmo_connect_vert_pair_exec(BMesh *bm, BMOperator *op)
 				negate_v3(basis_nor_b);
 			}
 			add_v3_v3v3(basis_nor, basis_nor_a, basis_nor_b);
-
-			if (UNLIKELY(fabsf(dot_v3v3(basis_nor, basis_dir)) < FLT_EPSILON)) {
-				ortho_v3_v3(basis_nor, basis_dir);
-			}
 		}
 #endif
 
 		/* get third axis */
+		normalize_v3(basis_dir);
+		normalize_v3(basis_nor);
 		cross_v3_v3v3(basis_tmp, basis_dir, basis_nor);
+		if (UNLIKELY(normalize_v3(basis_tmp) < FLT_EPSILON)) {
+			ortho_v3_v3(basis_nor, basis_dir);
+			normalize_v3(basis_nor);
+			cross_v3_v3v3(basis_tmp, basis_dir, basis_nor);
+			normalize_v3(basis_tmp);
+		}
 
-		normalize_v3_v3(pc.matrix[0], basis_tmp);
-		normalize_v3_v3(pc.matrix[1], basis_dir);
-		normalize_v3_v3(pc.matrix[2], basis_nor);
+		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);
 
 		pc.axis_sep = dot_m3_v3_row_x(pc.matrix, pc.v_a->co);




More information about the Bf-blender-cvs mailing list