Commit: ac2ebf9c54a9081662ab17f04240c00d9e5ac799
Author: Campbell Barton
Date:   Thu Jan 11 10:57:30 2018 +1100
Branches: master
https://developer.blender.org/rBac2ebf9c54a9081662ab17f04240c00d9e5ac799

Fix T53455: Object disappear w/ TrackTo constraint

Regression caused by own commit 16fbb47c886,
this is really an edge case though since calling normalize twice fixes.

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

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

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

diff --git a/source/blender/blenkernel/intern/constraint.c 
b/source/blender/blenkernel/intern/constraint.c
index a5d0df88198..c77cac7bcbd 100644
--- a/source/blender/blenkernel/intern/constraint.c
+++ b/source/blender/blenkernel/intern/constraint.c
@@ -1018,8 +1018,11 @@ static void vectomat(const float vec[3], const float 
target_up[3], short axis, s
                u[2] = 1;
        }
 
+       /* note: even though 'n' is normalized, don't use 
'project_v3_v3v3_normalized' below
+        * because precision issues cause a problem in near degenerate states, 
see: T53455. */
+
        /* project the up vector onto the plane specified by n */
-       project_v3_v3v3_normalized(proj, u, n); /* first u onto n... */
+       project_v3_v3v3(proj, u, n); /* first u onto n... */
        sub_v3_v3v3(proj, u, proj); /* then onto the plane */
        /* proj specifies the transformation of the up axis */

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to