Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2011-09-19 19:13:16 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-09-19 19:13:16 +0400
commit05683f8e52119198c3ee053dd0a107caf83859b1 (patch)
treea8af5043609e6551a8306bb53f19f024061305c5 /source/blender/python/mathutils/mathutils_Euler.c
parent0f5d3a3ddb4586096322bcd3c894c9557f04e487 (diff)
edits to argument parsing for Euler.rotate_axis, also corrected some exception messages and minor style edits.
Diffstat (limited to 'source/blender/python/mathutils/mathutils_Euler.c')
-rw-r--r--source/blender/python/mathutils/mathutils_Euler.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/source/blender/python/mathutils/mathutils_Euler.c b/source/blender/python/mathutils/mathutils_Euler.c
index 5c609d8961f..c96eafcd6ad 100644
--- a/source/blender/python/mathutils/mathutils_Euler.c
+++ b/source/blender/python/mathutils/mathutils_Euler.c
@@ -196,16 +196,18 @@ PyDoc_STRVAR(Euler_rotate_axis_doc,
static PyObject *Euler_rotate_axis(EulerObject * self, PyObject *args)
{
float angle = 0.0f;
- const char *axis;
+ int axis; /* actually a character */
- if(!PyArg_ParseTuple(args, "sf:rotate", &axis, &angle)){
+ if(!PyArg_ParseTuple(args, "Cf:rotate", &axis, &angle)){
PyErr_SetString(PyExc_TypeError,
- "euler.rotate(): "
- "expected angle (float) and axis (x, y, z)");
+ "Euler.rotate_axis(): "
+ "expected an axis 'X', 'Y', 'Z' and an angle (float)");
return NULL;
}
- if(!(ELEM3(*axis, 'X', 'Y', 'Z') && axis[1]=='\0')){
- PyErr_SetString(PyExc_ValueError, "euler.rotate(): "
+
+ if(!(ELEM3(axis, 'X', 'Y', 'Z'))){
+ PyErr_SetString(PyExc_ValueError,
+ "Euler.rotate_axis(): "
"expected axis to be 'X', 'Y' or 'Z'");
return NULL;
}
@@ -214,7 +216,7 @@ static PyObject *Euler_rotate_axis(EulerObject * self, PyObject *args)
return NULL;
- rotate_eulO(self->eul, self->order, *axis, angle);
+ rotate_eulO(self->eul, self->order, (char)axis, angle);
(void)BaseMath_WriteCallback(self);