diff options
author | Campbell Barton <ideasman42@gmail.com> | 2008-08-05 13:35:46 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2008-08-05 13:35:46 +0400 |
commit | cd1d46c61d937f63684216f284777f75038f5ed3 (patch) | |
tree | a0b4c2e81d908a08952872d1811af9da179c721f /source/gameengine/Ketsji/KX_PythonInit.cpp | |
parent | 9e968cea4743640848a6e878de7fc1de47dc69b3 (diff) |
Added GameLogic.Mathutils so Mathutils and its types can be accessed from blenderplayer.
also changed importText so it dosnt do a malloc
Diffstat (limited to 'source/gameengine/Ketsji/KX_PythonInit.cpp')
-rw-r--r-- | source/gameengine/Ketsji/KX_PythonInit.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/source/gameengine/Ketsji/KX_PythonInit.cpp b/source/gameengine/Ketsji/KX_PythonInit.cpp index b66c3e42606..57ee52f9880 100644 --- a/source/gameengine/Ketsji/KX_PythonInit.cpp +++ b/source/gameengine/Ketsji/KX_PythonInit.cpp @@ -62,6 +62,10 @@ #include "KX_PyMath.h" +extern "C" { + #include "Mathutils.h" // Blender.Mathutils module copied here so the blenderlayer can use. +} + #include "PHY_IPhysicsEnvironment.h" // FIXME: Enable for access to blender python modules. This is disabled because // python has dependencies on a lot of other modules and is a pain to link. @@ -733,7 +737,10 @@ PyObject* initGameLogic(KX_Scene* scene) // quick hack to get gravity hook ErrorObject = PyString_FromString("GameLogic.error"); PyDict_SetItemString(d, "error", ErrorObject); - + + // Add Blender.Mathutils module, duplicate code :/ + PyDict_SetItemString(d, "Mathutils", Mathutils_Init("GameLogic.Mathutils")); + // XXXX Add constants here /* To use logic bricks, we need some sort of constants. Here, we associate */ /* constants and sumbolic names. Add them to dictionary d. */ |