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:
authorNathan Letwory <nathan@letworyinteractive.com>2008-02-23 15:05:28 +0300
committerNathan Letwory <nathan@letworyinteractive.com>2008-02-23 15:05:28 +0300
commit012f0a336c84b22c3e20716e4820f3342afef5d3 (patch)
tree00170e02918c2ae92c1c9a3b6e6145c01f954a15 /source/gameengine
parent206021113da61f352d96805af7e82e9d41dd70b9 (diff)
=== PyNodes ===
* Make PyNodes work with threaded renderer. This patch is by Willian. He has worked hard on getting this sorted out - now you should be able to render with PyNodes AND multiple threads.
Diffstat (limited to 'source/gameengine')
-rw-r--r--source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp b/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp
index e89c78614cc..e412fcdf748 100644
--- a/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp
+++ b/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp
@@ -135,6 +135,10 @@ extern "C" void StartKetsjiShell(struct ScrArea *area,
STR_String exitstring = "";
BlendFileData *bfd= NULL;
+ // Acquire Python's GIL (global interpreter lock)
+ // so we can safely run Python code and API calls
+ PyGILState_STATE gilstate = PyGILState_Ensure();
+
bgl::InitExtensions(1);
do
@@ -464,6 +468,9 @@ extern "C" void StartKetsjiShell(struct ScrArea *area,
} while (exitrequested == KX_EXIT_REQUEST_RESTART_GAME || exitrequested == KX_EXIT_REQUEST_START_OTHER_GAME);
if (bfd) BLO_blendfiledata_free(bfd);
+
+ // Release Python's GIL
+ PyGILState_Release(gilstate);
}
extern "C" void StartKetsjiShellSimulation(struct ScrArea *area,
@@ -482,6 +489,10 @@ extern "C" void StartKetsjiShellSimulation(struct ScrArea *area,
STR_String exitstring = "";
BlendFileData *bfd= NULL;
+ // Acquire Python's GIL (global interpreter lock)
+ // so we can safely run Python code and API calls
+ PyGILState_STATE gilstate = PyGILState_Ensure();
+
bgl::InitExtensions(1);
do
@@ -669,4 +680,7 @@ extern "C" void StartKetsjiShellSimulation(struct ScrArea *area,
} while (exitrequested == KX_EXIT_REQUEST_RESTART_GAME || exitrequested == KX_EXIT_REQUEST_START_OTHER_GAME);
if (bfd) BLO_blendfiledata_free(bfd);
+
+ // Release Python's GIL
+ PyGILState_Release(gilstate);
}