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:
authorJacques Lucke <mail@jlucke.com>2018-11-23 13:51:42 +0300
committerJacques Lucke <mail@jlucke.com>2018-11-23 13:52:09 +0300
commit4b06d0bf51c38c4358c07823358589ca1cdc6f47 (patch)
tree45f1b53cbd136385e2baec687dc1f4c699072601 /source/blender/blenkernel/intern/scene.c
parent2ded8fca7941a7092b80dc66d423056b1483afef (diff)
Python API: bpy.app.handlers.depsgraph_update_pre/post
Reviewers: brecht Differential Revision: https://developer.blender.org/D3978
Diffstat (limited to 'source/blender/blenkernel/intern/scene.c')
-rw-r--r--source/blender/blenkernel/intern/scene.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c
index 5213afc3805..73b800076d1 100644
--- a/source/blender/blenkernel/intern/scene.c
+++ b/source/blender/blenkernel/intern/scene.c
@@ -1412,6 +1412,11 @@ void BKE_scene_graph_update_tagged(Depsgraph *depsgraph,
Scene *scene = DEG_get_input_scene(depsgraph);
ViewLayer *view_layer = DEG_get_input_view_layer(depsgraph);
+ bool run_callbacks = DEG_id_type_any_updated(depsgraph);
+ if (run_callbacks) {
+ BLI_callback_exec(bmain, &scene->id, BLI_CB_EVT_DEPSGRAPH_UPDATE_PRE);
+ }
+
/* TODO(sergey): Some functions here are changing global state,
* for example, clearing update tags from bmain.
*/
@@ -1429,6 +1434,11 @@ void BKE_scene_graph_update_tagged(Depsgraph *depsgraph,
DEG_evaluate_on_refresh(depsgraph);
/* Update sound system animation (TODO, move to depsgraph). */
BKE_sound_update_scene(bmain, scene);
+
+ /* Notify python about depsgraph update */
+ if (run_callbacks) {
+ BLI_callback_exec(bmain, &scene->id, BLI_CB_EVT_DEPSGRAPH_UPDATE_POST);
+ }
/* Inform editors about possible changes. */
DEG_ids_check_recalc(bmain, depsgraph, scene, view_layer, false);
/* Clear recalc flags. */