Blender Git Commit Log
Git Commits -> Revision dd6202e
Revision dd6202e by Benoit Bolsee (soc-2012-swiss_cheese) May 27, 2012, 17:39 (GMT) |
Hive main patch =============== Give the possibility to pass the game control to a python script, the game engine ends when the python script returns. This patch is necessary for the hive system because it needs to control the main loop. To active this feature, add a custom property "__main__" to the startup scene and set it to the name of a text block that contains the python script. "NextFrame" python function is provided in the GameLogic module to execute one frame of the BGE, i.e. logic bricks, physics and render. The function returns FALSE if the game hit an exit condition, TRUE otherwise. Example: # this python will reproduce the behavior of the BGE (with poor timing): import GameLogic, time while GameLogic.NextFrame(): time.sleep(0.016) Notes: * This feature is used internally by the hive system. * This interface is unstable, it may change in the future * It is not yet possible to load a new game or restart the game from python |
Commit Details:
Full Hash: dd6202ef074f1ac629e9046b656272874a0e7442
SVN Revision: 47084
Parent Commit: fea7955
Lines Changed: +343, -65
2 Added Paths:
/source/gameengine/Ketsji/KX_PythonMain.cpp (+78, -0) (View)
/source/gameengine/Ketsji/KX_PythonMain.h (+41, -0) (View)
/source/gameengine/Ketsji/KX_PythonMain.h (+41, -0) (View)
5 Modified Paths:
/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp (+127, -57) (Diff)
/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp (+67, -7) (Diff)
/source/gameengine/Ketsji/CMakeLists.txt (+2, -0) (Diff)
/source/gameengine/Ketsji/KX_PythonInit.cpp (+18, -1) (Diff)
/source/gameengine/Ketsji/KX_PythonInit.h (+10, -0) (Diff)
/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp (+67, -7) (Diff)
/source/gameengine/Ketsji/CMakeLists.txt (+2, -0) (Diff)
/source/gameengine/Ketsji/KX_PythonInit.cpp (+18, -1) (Diff)
/source/gameengine/Ketsji/KX_PythonInit.h (+10, -0) (Diff)