[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [39445] trunk/blender/source/blender/ python/mathutils/mathutils_Vector.c: remove support for deprecated Vector() * Matrix(), eventually this will be added back as row_vector_multiplication bu to avoid confusion for a bit just disable it altogether so script authors get an error on use and update their scripts .

Campbell Barton ideasman42 at gmail.com
Tue Aug 16 15:10:46 CEST 2011


Revision: 39445
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=39445
Author:   campbellbarton
Date:     2011-08-16 13:10:46 +0000 (Tue, 16 Aug 2011)
Log Message:
-----------
remove support for deprecated Vector() * Matrix(), eventually this will be added back as row_vector_multiplication bu to avoid confusion for a bit just disable it altogether so script authors get an error on use and update their scripts.

Modified Paths:
--------------
    trunk/blender/source/blender/python/mathutils/mathutils_Vector.c

Modified: trunk/blender/source/blender/python/mathutils/mathutils_Vector.c
===================================================================
--- trunk/blender/source/blender/python/mathutils/mathutils_Vector.c	2011-08-16 13:07:46 UTC (rev 39444)
+++ trunk/blender/source/blender/python/mathutils/mathutils_Vector.c	2011-08-16 13:10:46 UTC (rev 39445)
@@ -37,8 +37,6 @@
 #include "BLI_math.h"
 #include "BLI_utildefines.h"
 
-extern void PyC_LineSpit(void);
-
 #define MAX_DIMENSIONS 4
 
 /* Swizzle axes get packed into a single value that is used as a closure. Each
@@ -1161,28 +1159,18 @@
 	}
 	else if (vec1) {
 		if (MatrixObject_Check(v2)) {
-			extern void PyC_LineSpit(void);
 
-			/* VEC * MATRIX */
-			/* this is deprecated!, use the reverse instead */
-			float tvec[MAX_DIMENSIONS];
-
-
 /* ------ to be removed ------*/
-#ifndef MATH_STANDALONE
-#ifdef WITH_ASSERT_ABORT
+#if 1
 			PyErr_SetString(PyExc_ValueError,
 			                "(Vector * Matrix) is now removed, reverse the "
 			                "order (promoted to an Error for Debug builds)");
 			return NULL;
 #else
-			printf("Warning: (Vector * Matrix) is now deprecated, "
-			       "reverse the multiplication order in the script.\n");
-			PyC_LineSpit();
-#endif
-#endif		/* ifndef MATH_STANDALONE */
-/* ------ to be removed ------*/
 
+			/* VEC * MATRIX */
+			/* this is deprecated!, use the reverse instead */
+			float tvec[MAX_DIMENSIONS];
 
 			if(BaseMath_ReadCallback((MatrixObject *)v2) == -1)
 				return NULL;
@@ -1191,9 +1179,18 @@
 			}
 
 			return newVectorObject(tvec, vec1->size, Py_NEW, Py_TYPE(vec1));
+#endif
+/* ------ to be removed ------*/
 		}
 		else if (QuaternionObject_Check(v2)) {
 			/* VEC * QUAT */
+/* ------ to be removed ------*/
+#if 1
+			PyErr_SetString(PyExc_ValueError,
+			                "(Vector * Quat) is now removed, reverse the "
+			                "order (promoted to an Error for Debug builds)");
+			return NULL;
+#else
 			QuaternionObject *quat2 = (QuaternionObject*)v2;
 			float tvec[3];
 
@@ -1207,26 +1204,11 @@
 				return NULL;
 			}
 
-
-/* ------ to be removed ------*/
-#ifndef MATH_STANDALONE
-#ifdef WITH_ASSERT_ABORT
-			PyErr_SetString(PyExc_ValueError,
-			                "(Vector * Quat) is now removed, reverse the "
-			                "order (promoted to an Error for Debug builds)");
-			return NULL;
-#else
-			printf("Warning: (Vector * Quat) is now deprecated, "
-			       "reverse the multiplication order in the script.\n");
-			PyC_LineSpit();
-#endif
-#endif		/* ifndef MATH_STANDALONE */
-/* ------ to be removed ------*/
-
-
 			copy_v3_v3(tvec, vec1->vec);
 			mul_qt_v3(quat2->quat, tvec);
 			return newVectorObject(tvec, 3, Py_NEW, Py_TYPE(vec1));
+#endif
+/* ------ to be removed ------*/
 		}
 		else if (((scalar= PyFloat_AsDouble(v2)) == -1.0f && PyErr_Occurred())==0) { /* VEC * FLOAT */
 			return vector_mul_float(vec1, scalar);
@@ -1260,6 +1242,14 @@
 	/* only support vec*=float and vec*=mat
 	   vec*=vec result is a float so that wont work */
 	if (MatrixObject_Check(v2)) {
+/* ------ to be removed ------*/
+#if 1
+		PyErr_SetString(PyExc_ValueError,
+						"(Vector *= Matrix) is now removed, reverse the "
+						"order (promoted to an Error for Debug builds) "
+						"and uses the non in-place multiplication.");
+		return NULL;
+#else
 		float rvec[MAX_DIMENSIONS];
 		if(BaseMath_ReadCallback((MatrixObject *)v2) == -1)
 			return NULL;
@@ -1267,28 +1257,21 @@
 		if(column_vector_multiplication(rvec, vec, (MatrixObject*)v2) == -1)
 			return NULL;
 
-
-/* ------ to be removed ------*/
-#ifndef MATH_STANDALONE
-#ifdef WITH_ASSERT_ABORT
-			PyErr_SetString(PyExc_ValueError,
-							"(Vector *= Matrix) is now removed, reverse the "
-							"order (promoted to an Error for Debug builds) "
-			                "and uses the non in-place multiplication.");
-			return NULL;
-#else
-			printf("Warning: (Vector *= Matrix) is now deprecated, "
-				   "reverse the (non in-place) multiplication order in the script.\n");
-			PyC_LineSpit();
+		memcpy(vec->vec, rvec, sizeof(float) * vec->size);
 #endif
-#endif		/* ifndef MATH_STANDALONE */
 /* ------ to be removed ------*/
-
-
-		memcpy(vec->vec, rvec, sizeof(float) * vec->size);
 	}
 	else if (QuaternionObject_Check(v2)) {
 		/* VEC *= QUAT */
+
+/* ------ to be removed ------*/
+#if 1
+		PyErr_SetString(PyExc_ValueError,
+						"(Vector *= Quat) is now removed, reverse the "
+						"order (promoted to an Error for Debug builds) "
+						"and uses the non in-place multiplication.");
+		return NULL;
+#else
 		QuaternionObject *quat2 = (QuaternionObject*)v2;
 
 		if(vec->size != 3) {
@@ -1302,25 +1285,9 @@
 			return NULL;
 		}
 
-
-/* ------ to be removed ------*/
-#ifndef MATH_STANDALONE
-#ifdef WITH_ASSERT_ABORT
-			PyErr_SetString(PyExc_ValueError,
-							"(Vector *= Quat) is now removed, reverse the "
-							"order (promoted to an Error for Debug builds) "
-			                "and uses the non in-place multiplication.");
-			return NULL;
-#else
-			printf("Warning: (Vector *= Quat) is now deprecated, "
-				   "reverse the (non in-place) multiplication order in the script.\n");
-			PyC_LineSpit();
+		mul_qt_v3(quat2->quat, vec->vec);
 #endif
-#endif		/* ifndef MATH_STANDALONE */
 /* ------ to be removed ------*/
-
-
-		mul_qt_v3(quat2->quat, vec->vec);
 	}
 	else if (((scalar= PyFloat_AsDouble(v2)) == -1.0f && PyErr_Occurred())==0) { /* VEC *= FLOAT */
 		mul_vn_fl(vec->vec, vec->size, scalar);




More information about the Bf-blender-cvs mailing list