Revision: 26334
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=26334
Author:   campbellbarton
Date:     2010-01-27 13:53:25 +0100 (Wed, 27 Jan 2010)

Log Message:
-----------
crash fix from own recent updates to Mathutils.RotationMatrix()

Modified Paths:
--------------
    trunk/blender/source/blender/python/generic/Mathutils.c

Modified: trunk/blender/source/blender/python/generic/Mathutils.c
===================================================================
--- trunk/blender/source/blender/python/generic/Mathutils.c     2010-01-27 
11:58:04 UTC (rev 26333)
+++ trunk/blender/source/blender/python/generic/Mathutils.c     2010-01-27 
12:53:25 UTC (rev 26334)
@@ -207,7 +207,11 @@
        angle = angle * (float) (Py_PI / 180);
 #endif
 
-       if(axis == NULL && matSize == 2) {
+       /* check for valid vector/axis above */
+       if(vec) {
+               axis_angle_to_mat3( (float (*)[3])mat,vec->vec, angle);
+       }
+       else if(matSize == 2) {
                //2D rotation matrix
                mat[0] = (float) cos (angle);
                mat[1] = (float) sin (angle);
@@ -234,10 +238,12 @@
                mat[3] = -((float) sin(angle));
                mat[4] = (float) cos(angle);
                mat[8] = 1.0f;
-       } else {
-               /* check for valid vector/axis above */
-               axis_angle_to_mat3( (float (*)[3])mat,vec->vec, angle);
        }
+       else {
+               /* should never get here */
+               PyErr_SetString(PyExc_AttributeError, 
"Mathutils.RotationMatrix(): unknown error\n");
+               return NULL;
+       }
 
        if(matSize == 4) {
                //resize matrix


_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to