diff options
author | Sybren A. Stüvel <sybren@stuvel.eu> | 2018-06-07 13:37:48 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@stuvel.eu> | 2018-06-07 13:37:55 +0300 |
commit | d1474371facd1dd975603954c310547c9d618fc0 (patch) | |
tree | 5ad6c774cf59465a7a2754baa148e13b465e0da2 | |
parent | a867e63dd68401b912afb99727bc52712d473fe9 (diff) |
Fixed deadlock on viewlayer update when there are drivers
When calling the bpy.ops.poselib.apply_pose() operator from Python, Blender
would deadlock when the rig has drivers.
Similar BPy_{BEGIN,END}_ALLOW_THREADS calls were already in place in the
rna_Scene_update_tagged() function.
-rw-r--r-- | source/blender/makesrna/intern/rna_layer.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_layer.c b/source/blender/makesrna/intern/rna_layer.c index 1d8c7c1f248..060b075cb29 100644 --- a/source/blender/makesrna/intern/rna_layer.c +++ b/source/blender/makesrna/intern/rna_layer.c @@ -49,6 +49,10 @@ #ifdef RNA_RUNTIME +#ifdef WITH_PYTHON +# include "BPY_extern.h" +#endif + #include "DNA_group_types.h" #include "DNA_object_types.h" @@ -165,9 +169,18 @@ static void rna_LayerObjects_selected_begin(CollectionPropertyIterator *iter, Po static void rna_ViewLayer_update_tagged(ID *id_ptr, ViewLayer *view_layer, Main *bmain) { +#ifdef WITH_PYTHON + /* Allow drivers to be evaluated */ + BPy_BEGIN_ALLOW_THREADS; +#endif + Scene *scene = (Scene *)id_ptr; Depsgraph *depsgraph = BKE_scene_get_depsgraph(scene, view_layer, true); BKE_scene_graph_update_tagged(depsgraph, bmain); + +#ifdef WITH_PYTHON + BPy_END_ALLOW_THREADS; +#endif } static void rna_ObjectBase_select_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) |