fix for Quaternion.to_axis_angle() returning a zero axis vector.
authorCampbell Barton <ideasman42@gmail.com>
Tue, 20 Mar 2012 23:37:54 +0000 (23:37 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 20 Mar 2012 23:37:54 +0000 (23:37 +0000)
source/blender/python/mathutils/mathutils_Quaternion.c

index 190c389388db2df512efdb63c9bdbef5d21d57ed..80910c409bc3dc97f03aa27a9dc2196ef12197b0 100644 (file)
@@ -1105,7 +1105,8 @@ static PyObject *quat__apply_to_copy(PyNoArgsFunction quat_func, QuaternionObjec
 static void quat__axis_angle_sanitize(float axis[3], float *angle)
 {
        if (axis) {
-               if (!finite(axis[0]) ||
+               if (is_zero_v3(axis) ||
+                   !finite(axis[0]) ||
                    !finite(axis[1]) ||
                    !finite(axis[2]))
                {