[Bf-blender-cvs] [8d8f7314706] master: Depsgraph: Make depsgraph.update() safe for threading

Sergey Sharybin noreply at git.blender.org
Thu May 16 14:53:42 CEST 2019


Commit: 8d8f73147065851a41e832b01f34d505e25c565a
Author: Sergey Sharybin
Date:   Thu May 16 14:53:01 2019 +0200
Branches: master
https://developer.blender.org/rB8d8f73147065851a41e832b01f34d505e25c565a

Depsgraph: Make depsgraph.update() safe for threading

This is same as view_layer.update() is doing.

===================================================================

M	source/blender/makesrna/intern/rna_depsgraph.c

===================================================================

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 */



More information about the Bf-blender-cvs mailing list