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/builder/deg_builder_relations.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/builder/deg_builder_relations.cc')
-rw-r--r-- | source/blender/depsgraph/intern/builder/deg_builder_relations.cc | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc index 54d5223497e..a1f8c59f936 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc @@ -58,6 +58,7 @@ extern "C" { #include "DNA_object_types.h" #include "DNA_rigidbody_types.h" #include "DNA_scene_types.h" +#include "DNA_sequence_types.h" #include "DNA_sound_types.h" #include "DNA_speaker_types.h" #include "DNA_texture_types.h" @@ -84,6 +85,7 @@ extern "C" { #include "BKE_particle.h" #include "BKE_pointcache.h" #include "BKE_rigidbody.h" +#include "BKE_sequencer.h" #include "BKE_shader_fx.h" #include "BKE_shrinkwrap.h" #include "BKE_sound.h" @@ -2324,6 +2326,35 @@ void DepsgraphRelationBuilder::build_sound(bSound *sound) build_parameters(&sound->id); } +void DepsgraphRelationBuilder::build_scene_sequencer(Scene *scene) +{ + if (scene->ed == NULL) { + return; + } + /* Make sure dependencies from sequences data goes to the sequencer evaluation. */ + ComponentKey sequencer_key(&scene->id, NodeType::SEQUENCER); + Sequence *seq; + bool has_audio_strips = false; + SEQ_BEGIN (scene->ed, seq) { + if (seq->sound != NULL) { + build_sound(seq->sound); + ComponentKey sound_key(&seq->sound->id, NodeType::AUDIO); + add_relation(sound_key, sequencer_key, "Sound -> Sequencer"); + has_audio_strips = true; + } + /* TODO(sergey): Movie clip, scene, camera, mask. */ + } + SEQ_END; + if (has_audio_strips) { + ComponentKey scene_audio_key(&scene->id, NodeType::AUDIO); + add_relation(sequencer_key, scene_audio_key, "Sequencer -> Audio"); + } +} + +void DepsgraphRelationBuilder::build_scene_audio(Scene * /*scene*/) +{ +} + void DepsgraphRelationBuilder::build_copy_on_write_relations() { for (IDNode *id_node : graph_->id_nodes) { @@ -2387,6 +2418,10 @@ void DepsgraphRelationBuilder::build_copy_on_write_relations(IDNode *id_node) (id_type == ID_CF && comp_node->type == NodeType::CACHE)) { rel_flag &= ~RELATION_FLAG_NO_FLUSH; } + /* TODO(sergey): Needs better solution for this. */ + if (id_type == ID_SO) { + rel_flag &= ~RELATION_FLAG_NO_FLUSH; + } /* Notes on exceptions: * - Parameters component is where drivers are living. Changing any * of the (custom) properties in the original datablock (even the |