[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [32182] trunk/blender/source/blender/ python/generic: moved mathutils Euler.rotate(angle, axis) --> Euler. rotate_axis(axis, angle)
Campbell Barton
ideasman42 at gmail.com
Wed Sep 29 10:07:58 CEST 2010
Revision: 32182
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=32182
Author: campbellbarton
Date: 2010-09-29 10:07:58 +0200 (Wed, 29 Sep 2010)
Log Message:
-----------
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.
Modified Paths:
--------------
trunk/blender/source/blender/python/generic/mathutils.c
trunk/blender/source/blender/python/generic/mathutils_euler.c
Modified: trunk/blender/source/blender/python/generic/mathutils.c
===================================================================
--- trunk/blender/source/blender/python/generic/mathutils.c 2010-09-29 07:55:13 UTC (rev 32181)
+++ trunk/blender/source/blender/python/generic/mathutils.c 2010-09-29 08:07:58 UTC (rev 32182)
@@ -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
Modified: trunk/blender/source/blender/python/generic/mathutils_euler.c
===================================================================
--- trunk/blender/source/blender/python/generic/mathutils_euler.c 2010-09-29 07:55:13 UTC (rev 32181)
+++ trunk/blender/source/blender/python/generic/mathutils_euler.c 2010-09-29 08:07:58 UTC (rev 32182)
@@ -229,24 +229,24 @@
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 axis: single character in ['X, 'Y', 'Z'].\n"
+" :type axis: string\n"
" :arg angle: angle in radians.\n"
" :type angle: float\n"
-" :arg axis: single character in ['X, 'Y', 'Z'].\n"
-" :type axis: string\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 @@
{"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},
More information about the Bf-blender-cvs
mailing list