diff options
Diffstat (limited to 'source/blender/depsgraph')
-rw-r--r-- | source/blender/depsgraph/DEG_depsgraph.h | 8 | ||||
-rw-r--r-- | source/blender/depsgraph/intern/depsgraph.cc | 12 |
2 files changed, 18 insertions, 2 deletions
diff --git a/source/blender/depsgraph/DEG_depsgraph.h b/source/blender/depsgraph/DEG_depsgraph.h index a772f4ee2e3..f37ba71ab65 100644 --- a/source/blender/depsgraph/DEG_depsgraph.h +++ b/source/blender/depsgraph/DEG_depsgraph.h @@ -205,10 +205,16 @@ typedef void (*DEG_EditorUpdateIDCb)(struct Main *bmain, struct ID *id); typedef void (*DEG_EditorUpdateSceneCb)(struct Main *bmain, struct Scene *scene, int updated); +typedef void (*DEG_EditorUpdateScenePreCb)(struct Main *bmain, + struct Scene *scene, + bool time); /* Set callbacks which are being called when depsgraph changes. */ void DEG_editors_set_update_cb(DEG_EditorUpdateIDCb id_func, - DEG_EditorUpdateSceneCb scene_func); + DEG_EditorUpdateSceneCb scene_func, + DEG_EditorUpdateScenePreCb scene_pre_func); + +void DEG_editors_update_pre(struct Main *bmain, struct Scene *scene, bool time); #ifdef __cplusplus } /* extern "C" */ diff --git a/source/blender/depsgraph/intern/depsgraph.cc b/source/blender/depsgraph/intern/depsgraph.cc index 2465654a723..a2c17b0fc8c 100644 --- a/source/blender/depsgraph/intern/depsgraph.cc +++ b/source/blender/depsgraph/intern/depsgraph.cc @@ -58,6 +58,7 @@ extern "C" { static DEG_EditorUpdateIDCb deg_editor_update_id_cb = NULL; static DEG_EditorUpdateSceneCb deg_editor_update_scene_cb = NULL; +static DEG_EditorUpdateScenePreCb deg_editor_update_scene_pre_cb = NULL; Depsgraph::Depsgraph() : root_node(NULL), @@ -467,10 +468,19 @@ void DEG_graph_free(Depsgraph *graph) /* Set callbacks which are being called when depsgraph changes. */ void DEG_editors_set_update_cb(DEG_EditorUpdateIDCb id_func, - DEG_EditorUpdateSceneCb scene_func) + DEG_EditorUpdateSceneCb scene_func, + DEG_EditorUpdateScenePreCb scene_pre_func) { deg_editor_update_id_cb = id_func; deg_editor_update_scene_cb = scene_func; + deg_editor_update_scene_pre_cb = scene_pre_func; +} + +void DEG_editors_update_pre(Main *bmain, Scene *scene, bool time) +{ + if (deg_editor_update_scene_pre_cb != NULL) { + deg_editor_update_scene_pre_cb(bmain, scene, time); + } } void deg_editors_id_update(Main *bmain, ID *id) |