diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2011-09-19 18:20:15 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2011-09-19 18:20:15 +0400 |
commit | 153e4cad4be9455e47b823745c9fa6cbe0305e52 (patch) | |
tree | cdfd2179f0ad043256ddac4a23ccec088f3a89a5 /source/blender/python | |
parent | e9b967d05b366783a93d92d6935e970c1ea42edd (diff) | |
parent | 5c7b5c0b51f57ad19b79eac78e3e4afb263b23cc (diff) |
Cycles: svn merge -r40266:40358 https://svn.blender.org/svnroot/bf-blender/trunk/blender
Diffstat (limited to 'source/blender/python')
-rw-r--r-- | source/blender/python/generic/bgl.c | 12 | ||||
-rw-r--r-- | source/blender/python/mathutils/mathutils_Matrix.c | 43 |
2 files changed, 12 insertions, 43 deletions
diff --git a/source/blender/python/generic/bgl.c b/source/blender/python/generic/bgl.c index ae8069cf3c5..44d42a479ec 100644 --- a/source/blender/python/generic/bgl.c +++ b/source/blender/python/generic/bgl.c @@ -61,9 +61,9 @@ static PySequenceMethods Buffer_SeqMethods = { (binaryfunc) NULL, /*sq_concat */ (ssizeargfunc) NULL, /*sq_repeat */ (ssizeargfunc) Buffer_item, /*sq_item */ - (ssizessizeargfunc) Buffer_slice, /*sq_slice, deprecated TODO, replace */ + (ssizessizeargfunc) NULL, /*sq_slice, deprecated, handled in Buffer_item */ (ssizeobjargproc) Buffer_ass_item, /*sq_ass_item */ - (ssizessizeobjargproc) Buffer_ass_slice, /*sq_ass_slice, deprecated TODO, replace */ + (ssizessizeobjargproc) NULL, /*sq_ass_slice, deprecated handled in Buffer_ass_item */ (objobjproc) NULL, /* sq_contains */ (binaryfunc) NULL, /* sq_inplace_concat */ (ssizeargfunc) NULL, /* sq_inplace_repeat */ @@ -112,13 +112,6 @@ static PyObject *Buffer_to_list_recursive(Buffer *self) return list; } -/* *DEPRECATED* 2011/7/17 bgl.Buffer.list */ -static PyObject *Buffer_list(Buffer *self, void *UNUSED(arg)) -{ - fprintf(stderr, "Warning: 'Buffer.list' deprecated, use '[:]' instead\n"); - return Buffer_to_list(self); -} - static PyObject *Buffer_dimensions(Buffer *self, void *UNUSED(arg)) { PyObject *list= PyList_New(self->ndimensions); @@ -138,7 +131,6 @@ static PyMethodDef Buffer_methods[] = { }; static PyGetSetDef Buffer_getseters[] = { - {(char *)"list", (getter)Buffer_list, NULL, NULL, NULL}, {(char *)"dimensions", (getter)Buffer_dimensions, NULL, NULL, NULL}, {NULL, NULL, NULL, NULL, NULL} }; diff --git a/source/blender/python/mathutils/mathutils_Matrix.c b/source/blender/python/mathutils/mathutils_Matrix.c index 3953171f263..2da96dc62e6 100644 --- a/source/blender/python/mathutils/mathutils_Matrix.c +++ b/source/blender/python/mathutils/mathutils_Matrix.c @@ -266,42 +266,19 @@ static PyObject *C_Matrix_Rotation(PyObject *cls, PyObject *args) axis_angle_to_mat3((float (*)[3])mat, tvec, angle); } - else if(matSize == 2) { + else if (matSize == 2) { + const float angle_cos= cosf(angle); + const float angle_sin= sinf(angle); + //2D rotation matrix - mat[0] = (float) cos (angle); - mat[1] = (float) sin (angle); - mat[2] = -((float) sin(angle)); - mat[3] = (float) cos(angle); - } - else if(strcmp(axis, "X") == 0) { - //rotation around X - mat[0] = 1.0f; - mat[4] = (float) cos(angle); - mat[5] = (float) sin(angle); - mat[7] = -((float) sin(angle)); - mat[8] = (float) cos(angle); - } - else if(strcmp(axis, "Y") == 0) { - //rotation around Y - mat[0] = (float) cos(angle); - mat[2] = -((float) sin(angle)); - mat[4] = 1.0f; - mat[6] = (float) sin(angle); - mat[8] = (float) cos(angle); - } - else if(strcmp(axis, "Z") == 0) { - //rotation around Z - mat[0] = (float) cos(angle); - mat[1] = (float) sin(angle); - mat[3] = -((float) sin(angle)); - mat[4] = (float) cos(angle); - mat[8] = 1.0f; + mat[0] = angle_cos; + mat[1] = angle_sin; + mat[2] = -angle_sin; + mat[3] = angle_cos; } else { - /* should never get here */ - PyErr_SetString(PyExc_ValueError, - "mathutils.RotationMatrix(): unknown error"); - return NULL; + /* valid axis checked above */ + single_axis_angle_to_mat3((float (*)[3])mat, axis[0], angle); } if(matSize == 4) { |