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>2019-05-16 15:53:01 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2019-05-16 15:53:38 +0300
commit8d8f73147065851a41e832b01f34d505e25c565a (patch)
treebc51a1f8a96025e66fee51458eb4e0c749407cbe /source/blender/makesrna/intern/rna_depsgraph.c
parentcfac269d258be8b1ba569a2c8ccffeb271247656 (diff)
Depsgraph: Make depsgraph.update() safe for threading
This is same as view_layer.update() is doing.
Diffstat (limited to 'source/blender/makesrna/intern/rna_depsgraph.c')
-rw-r--r--source/blender/makesrna/intern/rna_depsgraph.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_depsgraph.c b/source/blender/makesrna/intern/rna_depsgraph.c
index 08f37de26ee..c4a2a64f3f0 100644
--- a/source/blender/makesrna/intern/rna_depsgraph.c
+++ b/source/blender/makesrna/intern/rna_depsgraph.c
@@ -36,6 +36,10 @@
#ifdef RNA_RUNTIME
+# ifdef WITH_PYTHON
+# include "BPY_extern.h"
+# endif
+
# include "BLI_iterator.h"
# include "BLI_math.h"
@@ -259,7 +263,16 @@ static void rna_Depsgraph_debug_stats(Depsgraph *depsgraph, char *result)
static void rna_Depsgraph_update(Depsgraph *depsgraph, Main *bmain)
{
+# ifdef WITH_PYTHON
+ /* Allow drivers to be evaluated */
+ BPy_BEGIN_ALLOW_THREADS;
+# endif
+
BKE_scene_graph_update_tagged(depsgraph, bmain);
+
+# ifdef WITH_PYTHON
+ BPy_END_ALLOW_THREADS;
+# endif
}
/* Iteration over objects, simple version */