diff options
author | Campbell Barton <ideasman42@gmail.com> | 2015-01-29 18:12:02 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2015-01-29 18:12:07 +0300 |
commit | 79ba5e52dd6f7405e34a8773275af975ad1c06d9 (patch) | |
tree | 39ef9e657dfd9a5696f5d2f4640afb1e426f519d /source | |
parent | 7ce7cb5e0ff54b28581c4f02e8837ba6a88f7005 (diff) |
Revert "mathutils: let Vector.normalize() return the original length."
Please discuss changes to core mathutils functions first.
Changes like this should be considered and applied to all areas of the API (or not at all).
Missed quaternion, matrix normalize for eg.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/python/mathutils/mathutils_Vector.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/source/blender/python/mathutils/mathutils_Vector.c b/source/blender/python/mathutils/mathutils_Vector.c index 640a3358386..167fb5bcf3d 100644 --- a/source/blender/python/mathutils/mathutils_Vector.c +++ b/source/blender/python/mathutils/mathutils_Vector.c @@ -349,9 +349,6 @@ PyDoc_STRVAR(Vector_normalize_doc, "\n" " Normalize the vector, making the length of the vector always 1.0.\n" "\n" -" :return: the original length of the vector, before normalization\n" -" :rtype: float\n" -"\n" " .. warning:: Normalizing a vector where all values are zero has no effect.\n" "\n" " .. note:: Normalize works for vectors of all sizes,\n" @@ -359,15 +356,14 @@ PyDoc_STRVAR(Vector_normalize_doc, ); static PyObject *Vector_normalize(VectorObject *self) { - float length; int size = (self->size == 4 ? 3 : self->size); if (BaseMath_ReadCallback(self) == -1) return NULL; - length = normalize_vn(self->vec, size); + normalize_vn(self->vec, size); (void)BaseMath_WriteCallback(self); - return PyFloat_FromDouble(length); + Py_RETURN_NONE; } PyDoc_STRVAR(Vector_normalized_doc, ".. method:: normalized()\n" |