diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-06-04 17:52:48 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-06-05 15:23:54 +0300 |
commit | bbaa1bffe9dbc35d2791b83d0014ccb4ffb6087a (patch) | |
tree | d0ded24e2fb254943831cacca7c28b7752e57eae /source/blender/depsgraph/intern/depsgraph_query.cc | |
parent | 863b7b3668fe67a082439181eaf49c3e94a87536 (diff) |
Sound: Port to a copy-on-write concept
This change makes it so sound handles are created for evaluated scene,
sequencer and speakers. This allows to have properly evaluated animation
on them.
For the viewport playback sound uses regular dependency graph.
For the final render sound uses dependency graph created for render pipeline,
which now also contains sequencer and sound datablocks.
All the direct sound update calls are replaced with corresponding dependency
graph recalc tag.
Diffstat (limited to 'source/blender/depsgraph/intern/depsgraph_query.cc')
-rw-r--r-- | source/blender/depsgraph/intern/depsgraph_query.cc | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/source/blender/depsgraph/intern/depsgraph_query.cc b/source/blender/depsgraph/intern/depsgraph_query.cc index 0345f294860..865da20e6fd 100644 --- a/source/blender/depsgraph/intern/depsgraph_query.cc +++ b/source/blender/depsgraph/intern/depsgraph_query.cc @@ -160,6 +160,19 @@ Scene *DEG_get_evaluated_scene(const Depsgraph *graph) return scene_cow; } +Scene *DEG_get_evaluated_scene_if_exists(const Depsgraph *graph) +{ + if (graph == NULL) { + return NULL; + } + const DEG::Depsgraph *deg_graph = reinterpret_cast<const DEG::Depsgraph *>(graph); + Scene *scene_cow = deg_graph->scene_cow; + if (scene_cow == NULL || !DEG::deg_copy_on_write_is_expanded(&scene_cow->id)) { + return NULL; + } + return scene_cow; +} + ViewLayer *DEG_get_evaluated_view_layer(const Depsgraph *graph) { const DEG::Depsgraph *deg_graph = reinterpret_cast<const DEG::Depsgraph *>(graph); |