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>2006-08-08 18:34:38 +0400
committerCampbell Barton <ideasman42@gmail.com>2006-08-08 18:34:38 +0400
commitb44ae44c720128319a80709bda5071c0494beba8 (patch)
tree50283503bfeb1dec3086e6f2f3396cc7d4cb62ad /source/blender/python/api2_2x/Mathutils.c
parentfde5381a94e53d31fa7613c2eefed4d8354ac0f0 (diff)
Made RotationMatrix accept values outside 360,
added object.type to be used instead of .getType()
Diffstat (limited to 'source/blender/python/api2_2x/Mathutils.c')
-rw-r--r--source/blender/python/api2_2x/Mathutils.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/source/blender/python/api2_2x/Mathutils.c b/source/blender/python/api2_2x/Mathutils.c
index 1c48d517fa0..0fe11ecda0d 100644
--- a/source/blender/python/api2_2x/Mathutils.c
+++ b/source/blender/python/api2_2x/Mathutils.c
@@ -656,9 +656,13 @@ PyObject *M_Mathutils_RotationMatrix(PyObject * self, PyObject * args)
return EXPP_ReturnPyObjError (PyExc_TypeError,
"Mathutils.RotationMatrix(): expected float int and optional string and vector\n");
}
- if(angle < -360.0f || angle > 360.0f)
- return EXPP_ReturnPyObjError(PyExc_AttributeError,
- "Mathutils.RotationMatrix(): angle size not appropriate\n");
+
+ /* Clamp to -360:360 */
+ while (angle<-360.0f)
+ angle+=360.0;
+ while (angle>360.0f)
+ angle-=360.0;
+
if(matSize != 2 && matSize != 3 && matSize != 4)
return EXPP_ReturnPyObjError(PyExc_AttributeError,
"Mathutils.RotationMatrix(): can only return a 2x2 3x3 or 4x4 matrix\n");