diff options
author | Joseph Gilbert <ascotan@gmail.com> | 2005-11-21 22:42:20 +0300 |
---|---|---|
committer | Joseph Gilbert <ascotan@gmail.com> | 2005-11-21 22:42:20 +0300 |
commit | d5f1fc13b7cd9ab3e4a3d2519433b7359ae6fab0 (patch) | |
tree | 73d902a146484bcc9434df49d5263d551a37755d /source/blender/python/api2_2x/quat.c | |
parent | e9ea05815d8f4222c8be00b8841187b4287d6b58 (diff) |
* [ #3376 ] Blender.Mathutils.Matrix().toQuat() broken
- a 0-degree rotation gives a abitrary axis of 1,0,0 not 0,0,0
Diffstat (limited to 'source/blender/python/api2_2x/quat.c')
-rw-r--r-- | source/blender/python/api2_2x/quat.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/source/blender/python/api2_2x/quat.c b/source/blender/python/api2_2x/quat.c index 11b16e89c87..2b5fcc5966c 100644 --- a/source/blender/python/api2_2x/quat.c +++ b/source/blender/python/api2_2x/quat.c @@ -186,6 +186,10 @@ static PyObject *Quaternion_getattr(QuaternionObject * self, char *name) vec[x] = (float)(self->quat[x + 1] / mag); } Normalise(vec); + //If the axis of rotation is 0,0,0 set it to 1,0,0 - for zero-degree rotations + if (vec[0] < 1e-44 && vec[1] < 1e-44 && vec[2] < 1e-44){ + vec[0] = 1.0f; + } return (PyObject *) newVectorObject(vec, 3, Py_NEW); } if(STREQ(name, "wrapped")){ |