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:
authorPorteries Tristan <republicthunderbolt9@gmail.com>2015-08-23 15:30:44 +0300
committerPorteries Tristan <republicthunderbolt9@gmail.com>2015-08-23 15:34:04 +0300
commit8444f7ba2b2bbcc465b4890e2fe4d473181c0ef1 (patch)
treedc08cb1215704ad9e0f50f44560730a4168caa77 /source/gameengine/GamePlayer/ghost/GPG_ghost.cpp
parent2672ee77a0f9b3334ccd348ff3618b8df98798b6 (diff)
BGE: Fix T42679: Python physics environment not setted for python control script.
Diffstat (limited to 'source/gameengine/GamePlayer/ghost/GPG_ghost.cpp')
-rw-r--r--source/gameengine/GamePlayer/ghost/GPG_ghost.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp b/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp
index 6ff8451f1d9..23d5b89f140 100644
--- a/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp
+++ b/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp
@@ -43,6 +43,7 @@
#include "KX_KetsjiEngine.h"
#include "KX_PythonInit.h"
#include "KX_PythonMain.h"
+#include "KX_PyConstraintBinding.h" // for PHY_SetActiveEnvironment
/**********************************
* Begin Blender include block
@@ -1080,6 +1081,11 @@ int main(int argc, char** argv)
char *python_code = KX_GetPythonCode(maggie, python_main);
if (python_code) {
#ifdef WITH_PYTHON
+ // Set python environement variable.
+ KX_Scene *startscene = app.GetStartScene();
+ KX_SetActiveScene(startscene);
+ PHY_SetActiveEnvironment(startscene->GetPhysicsEnvironment());
+
gpg_nextframestate.system = system;
gpg_nextframestate.app = &app;
gpg_nextframestate.gs = &gs;