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.
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user