From ee387c6addb2a6c92b48525b0ee5b3b734430002 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Wed, 16 Apr 2014 18:20:27 +0200 Subject: Fix T39750: Bones disappearing with strange transforms. Fixed this issue and another similar one, and some minor optimizations. --- source/blender/blenkernel/intern/armature.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source/blender/blenkernel/intern/armature.c') diff --git a/source/blender/blenkernel/intern/armature.c b/source/blender/blenkernel/intern/armature.c index a8f533b8f55..b2b94992cb3 100644 --- a/source/blender/blenkernel/intern/armature.c +++ b/source/blender/blenkernel/intern/armature.c @@ -1488,7 +1488,7 @@ void vec_roll_to_mat3(const float vec[3], const float roll, float mat[3][3]) normalize_v3_v3(nor, vec); - theta = 1 + nor[1]; + theta = 1.0f + nor[1]; /* With old algo, 1.0e-13f caused T23954 and T31333, 1.0e-6f caused T27675 and T30438, * so using 1.0e-9f as best compromise. @@ -1496,7 +1496,7 @@ void vec_roll_to_mat3(const float vec[3], const float roll, float mat[3][3]) * New algo is supposed much more precise, since less complex computations are performed, * but it uses two different threshold values... */ - if (theta > 1.0e-9f) { + if ((nor[0] || nor[2]) && theta > 1.0e-9f) { /* nor is *not* -Y. * We got these values for free... so be happy with it... ;) */ -- cgit v1.2.3