diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-09-06 18:00:09 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-09-11 11:43:27 +0300 |
commit | 022de797f1773f512f21cf9038787dd77e0fd5de (patch) | |
tree | cc428b1a778d5a76c7ea931c5d10cb65a80dc7f0 /source/blender/depsgraph/intern/depsgraph.cc | |
parent | 73a199e96a68a5b9521ba7d3e8cca85697095c03 (diff) |
Depsgraph: Introduce depsgraph registry
Allows to access dependency graphs created for render engines
to inform them about changes in .blend file structure from the
Python handlers.
Reviewers: brecht
Differential Revision: https://developer.blender.org/D5724
Diffstat (limited to 'source/blender/depsgraph/intern/depsgraph.cc')
-rw-r--r-- | source/blender/depsgraph/intern/depsgraph.cc | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/source/blender/depsgraph/intern/depsgraph.cc b/source/blender/depsgraph/intern/depsgraph.cc index 6e98907597b..dcdea87fe1a 100644 --- a/source/blender/depsgraph/intern/depsgraph.cc +++ b/source/blender/depsgraph/intern/depsgraph.cc @@ -45,6 +45,8 @@ extern "C" { #include "DEG_depsgraph_debug.h" #include "intern/depsgraph_update.h" +#include "intern/depsgraph_physics.h" +#include "intern/depsgraph_registry.h" #include "intern/eval/deg_eval_copy_on_write.h" @@ -55,8 +57,6 @@ extern "C" { #include "intern/node/deg_node_operation.h" #include "intern/node/deg_node_time.h" -#include "intern/depsgraph_physics.h" - namespace DEG { /* TODO(sergey): Find a better place for this. */ @@ -318,14 +318,19 @@ Depsgraph *DEG_graph_new(Main *bmain, Scene *scene, ViewLayer *view_layer, eEval { DEG::Depsgraph *deg_depsgraph = OBJECT_GUARDED_NEW( DEG::Depsgraph, bmain, scene, view_layer, mode); + DEG::register_graph(deg_depsgraph); return reinterpret_cast<Depsgraph *>(deg_depsgraph); } /* Free graph's contents and graph itself */ void DEG_graph_free(Depsgraph *graph) { + if (graph == NULL) { + return; + } using DEG::Depsgraph; DEG::Depsgraph *deg_depsgraph = reinterpret_cast<DEG::Depsgraph *>(graph); + DEG::unregister_graph(deg_depsgraph); OBJECT_GUARDED_DELETE(deg_depsgraph, Depsgraph); } |