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-27 11:42:30 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2019-05-27 11:42:30 +0300
commit27d5d3c2f8bce8c27394f655b0ada3ff80f1c2ae (patch)
tree2117fe5ec4d618e4378fbbde005159130018d637 /source/blender/makesrna/intern/rna_context.c
parentc25164e16dceeadb519ee489d61f58d9885e2408 (diff)
Depsgraph: Use threading guard in context.evaluated_depsgraph_get
This is a part of T65174.
Diffstat (limited to 'source/blender/makesrna/intern/rna_context.c')
-rw-r--r--source/blender/makesrna/intern/rna_context.c19
1 files changed, 18 insertions, 1 deletions
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