diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-09-29 12:07:58 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-09-29 12:07:58 +0400 |
commit | 96aa1f9cd538e8e64c2860021eba7a8ecfe2bed9 (patch) | |
tree | 50c45e26f92c3afe8d0cf4224d3522f88e11fe9e /source/blender/python | |
parent | 0fa4ba175fa7f68a163c06a8879c73ba0ee3686d (diff) |
moved mathutils Euler.rotate(angle, axis) --> Euler.rotate_axis(axis, angle)
since it can only rotate about a single axis dont confuse with vector.rotate() which takes an axis vector.
Diffstat (limited to 'source/blender/python')
-rw-r--r-- | source/blender/python/generic/mathutils.c | 1 | ||||
-rw-r--r-- | source/blender/python/generic/mathutils_euler.c | 14 |
2 files changed, 8 insertions, 7 deletions
diff --git a/source/blender/python/generic/mathutils.c b/source/blender/python/generic/mathutils.c index a643e6621b2..e81bc0cf239 100644 --- a/source/blender/python/generic/mathutils.c +++ b/source/blender/python/generic/mathutils.c @@ -45,6 +45,7 @@ * - toQuat --> to_quat * - Vector.toTrackQuat --> Vector.to_track_quat * - Quaternion * Quaternion --> cross product (not dot product) + * - Euler.rotate(angle, axis) --> Euler.rotate_axis(axis, angle) * * moved into class functions. * - Mathutils.RotationMatrix -> mathutils.Matrix.Rotation diff --git a/source/blender/python/generic/mathutils_euler.c b/source/blender/python/generic/mathutils_euler.c index 84845002ce8..f85578dd31d 100644 --- a/source/blender/python/generic/mathutils_euler.c +++ b/source/blender/python/generic/mathutils_euler.c @@ -229,24 +229,24 @@ static PyObject *Euler_Zero(EulerObject * self) return (PyObject *)self; } -static char Euler_Rotate_doc[] = -".. method:: rotate(angle, axis)\n" +static char Euler_rotate_axis_doc[] = +".. method:: rotate_axis(axis, angle)\n" "\n" " Rotates the euler a certain amount and returning a unique euler rotation (no 720 degree pitches).\n" "\n" -" :arg angle: angle in radians.\n" -" :type angle: float\n" " :arg axis: single character in ['X, 'Y', 'Z'].\n" " :type axis: string\n" +" :arg angle: angle in radians.\n" +" :type angle: float\n" " :return: an instance of itself\n" " :rtype: :class:`Euler`"; -static PyObject *Euler_Rotate(EulerObject * self, PyObject *args) +static PyObject *Euler_rotate_axis(EulerObject * self, PyObject *args) { float angle = 0.0f; char *axis; - if(!PyArg_ParseTuple(args, "fs:rotate", &angle, &axis)){ + if(!PyArg_ParseTuple(args, "sf:rotate", &axis, &angle)){ PyErr_SetString(PyExc_TypeError, "euler.rotate(): expected angle (float) and axis (x,y,z)"); return NULL; } @@ -632,7 +632,7 @@ static struct PyMethodDef Euler_methods[] = { {"unique", (PyCFunction) Euler_Unique, METH_NOARGS, Euler_Unique_doc}, {"to_matrix", (PyCFunction) Euler_ToMatrix, METH_NOARGS, Euler_ToMatrix_doc}, {"to_quat", (PyCFunction) Euler_ToQuat, METH_NOARGS, Euler_ToQuat_doc}, - {"rotate", (PyCFunction) Euler_Rotate, METH_VARARGS, Euler_Rotate_doc}, + {"rotate_axis", (PyCFunction) Euler_rotate_axis, METH_VARARGS, Euler_rotate_axis_doc}, {"make_compatible", (PyCFunction) Euler_MakeCompatible, METH_O, Euler_MakeCompatible_doc}, {"__copy__", (PyCFunction) Euler_copy, METH_VARARGS, Euler_copy_doc}, {"copy", (PyCFunction) Euler_copy, METH_VARARGS, Euler_copy_doc}, |