[Bf-blender-cvs] [39dc3bc] master: Fix T40001: Opening a 2.66 blend file in 2.7, a bone appear "rolled but not rolled".

Bastien Montagne noreply at git.blender.org
Sat May 3 10:55:59 CEST 2014


Commit: 39dc3bce30215a7fbf130912b6025cb258f087e6
Author: Bastien Montagne
Date:   Sat May 3 08:49:29 2014 +0200
https://developer.blender.org/rB39dc3bce30215a7fbf130912b6025cb258f087e6

Fix T40001: Opening a 2.66 blend file in 2.7, a bone appear "rolled but not rolled".

Looks like some sign was lost in that complex matrix algebra (always be wary of squared values!).

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

M	source/blender/blenkernel/intern/armature.c

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

diff --git a/source/blender/blenkernel/intern/armature.c b/source/blender/blenkernel/intern/armature.c
index d030de0..fda252e 100644
--- a/source/blender/blenkernel/intern/armature.c
+++ b/source/blender/blenkernel/intern/armature.c
@@ -1522,7 +1522,7 @@ void vec_roll_to_mat3(const float vec[3], const float roll, float mat[3][3])
 		else {
 			/* If nor is too close to -Y, apply the special case. */
 			theta = nor[0] * nor[0] + nor[2] * nor[2];
-			bMatrix[0][0] = (nor[0] + nor[2]) * (nor[0] - nor[2]) / theta;
+			bMatrix[0][0] = (nor[0] + nor[2]) * (nor[0] - nor[2]) / -theta;
 			bMatrix[2][2] = -bMatrix[0][0];
 			bMatrix[2][0] = bMatrix[0][2] = 2.0f * nor[0] * nor[2] / theta;
 		}




More information about the Bf-blender-cvs mailing list