diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-01-11 01:15:29 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-01-11 01:15:29 +0300 |
commit | 1cb013f8771990542dc5ab72bcc285e5942605b6 (patch) | |
tree | 01a2efc832d73f2303d135774acfbaa9238d3d71 | |
parent | affe84a4536c6b7966aee227ae01edbf0861c60b (diff) |
evil 1 liner to get bge.logic, bge.render, bge.keys etc.. may eventually replace GameLogic, GameKeys module names.
-rw-r--r-- | source/gameengine/Ketsji/KX_PythonInit.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/source/gameengine/Ketsji/KX_PythonInit.cpp b/source/gameengine/Ketsji/KX_PythonInit.cpp index cd0bcefff3b..5e109770fee 100644 --- a/source/gameengine/Ketsji/KX_PythonInit.cpp +++ b/source/gameengine/Ketsji/KX_PythonInit.cpp @@ -1957,6 +1957,9 @@ void setupGamePython(KX_KetsjiEngine* ketsjiengine, KX_Scene* startscene, Main * #ifdef WITH_FFMPEG initVideoTexture(); #endif + + /* could be done a lot more nicely, but for now a quick way to get bge.* working */ + PyRun_SimpleString("__import__('sys').modules['bge']=[mod for mod in (type(__builtins__)('bge'), ) if mod.__dict__.update({'logic':__import__('GameLogic'), 'render':__import__('Rasterizer'), 'keys':__import__('GameKeys'), 'constraints':__import__('PhysicsConstraints'), 'types':__import__('GameTypes')}) is None][0]"); } static struct PyModuleDef Rasterizer_module_def = { |