mathutils types didnt work properly in python2x. vec*matrix failed for eg.
authorCampbell Barton <ideasman42@gmail.com>
Mon, 13 Jul 2009 12:17:07 +0000 (12:17 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Mon, 13 Jul 2009 12:17:07 +0000 (12:17 +0000)
Now with KX_Python.h line 35 commented YoFrankie 1.1 should run unmodified in blender2.5

source/blender/python/generic/Mathutils.c

index 651c5b8a26595d6a02c61b517acc58b0b040f2b2..5307765965585eb0d4c020c926608df014239215 100644 (file)
@@ -114,6 +114,13 @@ PyObject *Mathutils_Init(const char *from)
 
        //seed the generator for the rand function
        BLI_srand((unsigned int) (PIL_check_seconds_timer() * 0x7FFFFFFF));
+
+#if (PY_VERSION_HEX < 0x03000000)
+       vector_Type.tp_flags |= Py_TPFLAGS_CHECKTYPES;
+       matrix_Type.tp_flags |= Py_TPFLAGS_CHECKTYPES;
+       euler_Type.tp_flags |= Py_TPFLAGS_CHECKTYPES;
+       quaternion_Type.tp_flags |= Py_TPFLAGS_CHECKTYPES;
+#endif
        
        if( PyType_Ready( &vector_Type ) < 0 )
                return NULL;