diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-11-07 18:51:18 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-11-07 18:51:47 +0300 |
commit | 16fcf9dfbf6af527cfc06c5b251d144dc789f949 (patch) | |
tree | 93b509bc25ec9a0f1fc3a1839d4221f3dca9b895 /source/blender/depsgraph | |
parent | 52e529b82d66606da91107a3bf04d25e0267b78f (diff) |
Depsgraph: Get away from legacy API used in event loop
A bit tricky for now, needs some clear design about when to do
on_visible_changed().
Diffstat (limited to 'source/blender/depsgraph')
-rw-r--r-- | source/blender/depsgraph/intern/depsgraph_build.cc | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/source/blender/depsgraph/intern/depsgraph_build.cc b/source/blender/depsgraph/intern/depsgraph_build.cc index b6bf6c6fa78..ab7e28e1638 100644 --- a/source/blender/depsgraph/intern/depsgraph_build.cc +++ b/source/blender/depsgraph/intern/depsgraph_build.cc @@ -206,6 +206,14 @@ void DEG_graph_build_from_scene(Depsgraph *graph, Main *bmain, Scene *scene) DEG::Depsgraph *deg_graph = reinterpret_cast<DEG::Depsgraph *>(graph); + /* TODO(sergey): This is a bit tricky, but ensures that all the data + * is evaluated properly when depsgraph is becoming "visible". + * + * This now could happen for both visible scene is changed and extra + * dependency graph was created for render engine. + */ + const bool need_on_visible_update = (deg_graph->scene == NULL); + /* 1) Generate all the nodes in the graph first */ DEG::DepsgraphNodeBuilder node_builder(bmain, deg_graph); node_builder.begin_build(bmain); @@ -249,6 +257,10 @@ void DEG_graph_build_from_scene(Depsgraph *graph, Main *bmain, Scene *scene) /* Relations are up to date. */ deg_graph->need_update = false; + + if (need_on_visible_update) { + DEG_graph_on_visible_update(bmain, graph); + } } /* Tag graph relations for update. */ |