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>2009-06-22 08:26:48 +0400
committerCampbell Barton <ideasman42@gmail.com>2009-06-22 08:26:48 +0400
commitbce3f7e019c174947a0f98063f39533eb59ab03e (patch)
treebb66802258a156dec4a39f20c900a750fd7b6b55 /source/gameengine/Ketsji/KX_PythonInitTypes.cpp
parent1efffc1f564af0597512699890d7be9f41a6aee2 (diff)
PyAPI Mathutils Vector callbacks, referencing other PyObjects rather then thin wrapping vectors which is crash prone.
in short, vectors can work as if they are thin wrapped but not crash blender if the original data is removed. * RNA vector's return Mathutils vector types. * BGE vectors for GameObject's localPosition, worldPosition, localPosition, localScale, worldScale, localInertia. * Comment USE_MATHUTILS define to disable returning vectors. Example... * 2.49... * loc = gameOb.worldPosition loc[1] = 0 gameOb.worldPosition = loc * With vectors... * gameOb.worldPosition[1] = 0 * But this wont crash... * loc = gameOb.worldPosition gameOb.endObject() loc[1] = 0 # will raise an error that the objects removed. This breaks games which assume return values are lists. Will add this to eulers, matrix and quaternion types later.
Diffstat (limited to 'source/gameengine/Ketsji/KX_PythonInitTypes.cpp')
-rw-r--r--source/gameengine/Ketsji/KX_PythonInitTypes.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/source/gameengine/Ketsji/KX_PythonInitTypes.cpp b/source/gameengine/Ketsji/KX_PythonInitTypes.cpp
index 83c4dcbb34c..05cb818fdd9 100644
--- a/source/gameengine/Ketsji/KX_PythonInitTypes.cpp
+++ b/source/gameengine/Ketsji/KX_PythonInitTypes.cpp
@@ -231,6 +231,11 @@ void initPyTypes(void)
/* Normal python type */
PyType_Ready(&KX_PythonSeq_Type);
+
+#ifdef USE_MATHUTILS
+ /* Init mathutils callbacks */
+ KX_GameObject_Mathutils_Callback_Init();
+#endif
}
#endif \ No newline at end of file