[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [22794] branches/blender2.5/blender/source : - Mathutils.Vector assignment wasnt working in the BGE's py api, was using getValue() rather than setValue()

Campbell Barton ideasman42 at gmail.com
Wed Aug 26 08:15:44 CEST 2009


Revision: 22794
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=22794
Author:   campbellbarton
Date:     2009-08-26 08:15:43 +0200 (Wed, 26 Aug 2009)

Log Message:
-----------
- Mathutils.Vector assignment wasnt working in the BGE's py api, was using getValue() rather than setValue()
- added GPL header to bpy_interface.c from 2.4x's BPY_interface.c
- warning fixes

Modified Paths:
--------------
    branches/blender2.5/blender/source/blender/editors/object/object_vgroup.c
    branches/blender2.5/blender/source/blender/python/generic/bpy_internal_import.h
    branches/blender2.5/blender/source/blender/python/generic/vector.c
    branches/blender2.5/blender/source/blender/python/intern/bpy_interface.c
    branches/blender2.5/blender/source/gameengine/Ketsji/KX_PyMath.h
    branches/blender2.5/blender/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp

Modified: branches/blender2.5/blender/source/blender/editors/object/object_vgroup.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/object/object_vgroup.c	2009-08-26 05:59:12 UTC (rev 22793)
+++ branches/blender2.5/blender/source/blender/editors/object/object_vgroup.c	2009-08-26 06:15:43 UTC (rev 22794)
@@ -1076,7 +1076,7 @@
 				short nr;
 				
 				if (menustr) {
-// XXX					nr= pupmenu(menustr);
+					nr= 1; // pupmenu(menustr); // XXX
 					
 					if ((nr >= 1) && (nr <= defCount)) 
 						ob->actdef= nr;

Modified: branches/blender2.5/blender/source/blender/python/generic/bpy_internal_import.h
===================================================================
--- branches/blender2.5/blender/source/blender/python/generic/bpy_internal_import.h	2009-08-26 05:59:12 UTC (rev 22793)
+++ branches/blender2.5/blender/source/blender/python/generic/bpy_internal_import.h	2009-08-26 06:15:43 UTC (rev 22794)
@@ -31,6 +31,15 @@
 #ifndef EXPP_bpy_import_h
 #define EXPP_bpy_import_h
 
+/* python redefines :/ */
+#ifdef _POSIX_C_SOURCE
+#undef _POSIX_C_SOURCE
+#endif
+
+#ifdef _XOPEN_SOURCE
+#undef _XOPEN_SOURCE
+#endif
+
 #include <Python.h>
 #include "compile.h"		/* for the PyCodeObject */
 #include "eval.h"		/* for PyEval_EvalCode */

Modified: branches/blender2.5/blender/source/blender/python/generic/vector.c
===================================================================
--- branches/blender2.5/blender/source/blender/python/generic/vector.c	2009-08-26 05:59:12 UTC (rev 22793)
+++ branches/blender2.5/blender/source/blender/python/generic/vector.c	2009-08-26 06:15:43 UTC (rev 22794)
@@ -168,7 +168,7 @@
 		return NULL;
 	}
 	if(self->cb_user) {
-		PyErr_SetString(PyExc_TypeError, "vector.resize4d(): cannot resize a vector that has an owner");
+		PyErr_SetString(PyExc_TypeError, "vector.resize2d(): cannot resize a vector that has an owner");
 		return NULL;
 	}
 	
@@ -191,7 +191,7 @@
 		return NULL;
 	}
 	if(self->cb_user) {
-		PyErr_SetString(PyExc_TypeError, "vector.resize4d(): cannot resize a vector that has an owner");
+		PyErr_SetString(PyExc_TypeError, "vector.resize3d(): cannot resize a vector that has an owner");
 		return NULL;
 	}
 	

Modified: branches/blender2.5/blender/source/blender/python/intern/bpy_interface.c
===================================================================
--- branches/blender2.5/blender/source/blender/python/intern/bpy_interface.c	2009-08-26 05:59:12 UTC (rev 22793)
+++ branches/blender2.5/blender/source/blender/python/intern/bpy_interface.c	2009-08-26 06:15:43 UTC (rev 22794)
@@ -1,4 +1,28 @@
-
+/**
+ * $Id:
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ *
+ * Contributor(s): Michel Selten, Willian P. Germano, Stephen Swaney,
+ * Chris Keith, Chris Want, Ken Hughes, Campbell Barton
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+ 
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -10,6 +34,11 @@
 #include "BLI_winstuff.h"
 #endif
 
+/* grr, python redefines */
+#ifdef _POSIX_C_SOURCE
+#undef _POSIX_C_SOURCE
+#endif
+
 #include <Python.h>
 #include "compile.h"		/* for the PyCodeObject */
 #include "eval.h"		/* for PyEval_EvalCode */

Modified: branches/blender2.5/blender/source/gameengine/Ketsji/KX_PyMath.h
===================================================================
--- branches/blender2.5/blender/source/gameengine/Ketsji/KX_PyMath.h	2009-08-26 05:59:12 UTC (rev 22793)
+++ branches/blender2.5/blender/source/gameengine/Ketsji/KX_PyMath.h	2009-08-26 06:15:43 UTC (rev 22794)
@@ -113,7 +113,7 @@
 			PyErr_Format(PyExc_AttributeError, "error setting vector, %d args, should be %d", pyvec->size, Size(vec));
 			return false;
 		}
-		vec.getValue((float *) pyvec->vec);
+		vec.setValue((float *) pyvec->vec);
 		return true;
 	}
 	else if(QuaternionObject_Check(pyval)) {
@@ -123,7 +123,7 @@
 			return false;
 		}
 		/* xyzw -> wxyz reordering is done by PyQuatTo */
-		vec.getValue((float *) pyquat->quat);
+		vec.setValue((float *) pyquat->quat);
 		return true;
 	}
 	else if(EulerObject_Check(pyval)) {
@@ -132,7 +132,7 @@
 			PyErr_Format(PyExc_AttributeError, "error setting vector, %d args, should be %d", 3, Size(vec));
 			return false;
 		}
-		vec.getValue((float *) pyeul->eul);
+		vec.setValue((float *) pyeul->eul);
 		return true;
 	} else
 #endif

Modified: branches/blender2.5/blender/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp
===================================================================
--- branches/blender2.5/blender/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp	2009-08-26 05:59:12 UTC (rev 22793)
+++ branches/blender2.5/blender/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp	2009-08-26 06:15:43 UTC (rev 22794)
@@ -327,7 +327,6 @@
 :m_cullingCache(NULL),
 m_cullingTree(NULL),
 m_numIterations(10),
-m_scalingPropagated(false),
 m_numTimeSubSteps(1),
 m_ccdMode(0),
 m_solverType(-1),
@@ -336,7 +335,8 @@
 m_solver(NULL),
 m_ownPairCache(NULL),
 m_filterCallback(NULL),
-m_ownDispatcher(NULL)
+m_ownDispatcher(NULL),
+m_scalingPropagated(false)
 {
 
 	for (int i=0;i<PHY_NUM_RESPONSE;i++)





More information about the Bf-blender-cvs mailing list