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:
authorSergey Sharybin <sergey.vfx@gmail.com>2014-02-17 10:33:00 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2014-02-17 10:34:27 +0400
commit1562fd99f173898b3698972c90cdcb96c851dbbf (patch)
tree43c29e1de14f0ef5a0b17c4bb0a64a203aacc7d6 /source/blender/makesrna/intern/rna_screen.c
parent4134bdc75c8f7fe354d850e84503546d743e9382 (diff)
Fix T38664: Blender hang when change scene from script
Deadlock between python script evaluation thread and drivers evaluation caused by scene update invoked from ED_screen_set_scene(). Pretty much the same as setting scene current frame with the same solution BPy_{BEGIN,END}_ALLOW_THREADS.
Diffstat (limited to 'source/blender/makesrna/intern/rna_screen.c')
-rw-r--r--source/blender/makesrna/intern/rna_screen.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_screen.c b/source/blender/makesrna/intern/rna_screen.c
index 5f652601637..5902f3095fc 100644
--- a/source/blender/makesrna/intern/rna_screen.c
+++ b/source/blender/makesrna/intern/rna_screen.c
@@ -60,6 +60,10 @@ EnumPropertyItem region_type_items[] = {
#include "UI_view2d.h"
+#ifdef WITH_PYTHON
+# include "BPY_extern.h"
+#endif
+
static void rna_Screen_scene_set(PointerRNA *ptr, PointerRNA value)
{
bScreen *sc = (bScreen *)ptr->data;
@@ -76,7 +80,16 @@ static void rna_Screen_scene_update(bContext *C, PointerRNA *ptr)
/* exception: must use context so notifier gets to the right window */
if (sc->newscene) {
+#ifdef WITH_PYTHON
+ BPy_BEGIN_ALLOW_THREADS;
+#endif
+
ED_screen_set_scene(C, sc, sc->newscene);
+
+#ifdef WITH_PYTHON
+ BPy_END_ALLOW_THREADS;
+#endif
+
WM_event_add_notifier(C, NC_SCENE | ND_SCENEBROWSE, sc->newscene);
if (G.debug & G_DEBUG)