[Bf-blender-cvs] [27d5d3c2f8b] master: Depsgraph: Use threading guard in context.evaluated_depsgraph_get

Sergey Sharybin noreply at git.blender.org
Mon May 27 10:43:48 CEST 2019


Commit: 27d5d3c2f8bce8c27394f655b0ada3ff80f1c2ae
Author: Sergey Sharybin
Date:   Mon May 27 10:42:30 2019 +0200
Branches: master
https://developer.blender.org/rB27d5d3c2f8bce8c27394f655b0ada3ff80f1c2ae

Depsgraph: Use threading guard in context.evaluated_depsgraph_get

This is a part of T65174.

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

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

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

diff --git a/source/blender/makesrna/intern/rna_context.c b/source/blender/makesrna/intern/rna_context.c
index a2ac7cb40ba..9986b4c1674 100644
--- a/source/blender/makesrna/intern/rna_context.c
+++ b/source/blender/makesrna/intern/rna_context.c
@@ -57,6 +57,10 @@ const EnumPropertyItem rna_enum_context_mode_items[] = {
 
 #ifdef RNA_RUNTIME
 
+#  ifdef WITH_PYTHON
+#    include "BPY_extern.h"
+#  endif
+
 #  include "RE_engine.h"
 
 static PointerRNA rna_Context_manager_get(PointerRNA *ptr)
@@ -200,7 +204,20 @@ static int rna_Context_mode_get(PointerRNA *ptr)
 
 static struct Depsgraph *rna_Context_evaluated_depsgraph_get(bContext *C)
 {
-  return CTX_data_evaluated_depsgraph(C);
+  struct Depsgraph *depsgraph;
+
+#  ifdef WITH_PYTHON
+  /* Allow drivers to be evaluated */
+  BPy_BEGIN_ALLOW_THREADS;
+#  endif
+
+  depsgraph = CTX_data_evaluated_depsgraph(C);
+
+#  ifdef WITH_PYTHON
+  BPy_END_ALLOW_THREADS;
+#  endif
+
+  return depsgraph;
 }
 
 #else



More information about the Bf-blender-cvs mailing list