diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-05-27 11:42:30 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-05-27 11:42:30 +0300 |
commit | 27d5d3c2f8bce8c27394f655b0ada3ff80f1c2ae (patch) | |
tree | 2117fe5ec4d618e4378fbbde005159130018d637 /source/blender | |
parent | c25164e16dceeadb519ee489d61f58d9885e2408 (diff) |
Depsgraph: Use threading guard in context.evaluated_depsgraph_get
This is a part of T65174.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/makesrna/intern/rna_context.c | 19 |
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 |