diff options
Diffstat (limited to 'source/blender/depsgraph/intern/builder')
6 files changed, 58 insertions, 3 deletions
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc index d46eb8d04cb..563edafcb0e 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc @@ -58,6 +58,7 @@ extern "C" { #include "DNA_lightprobe_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" @@ -89,6 +90,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_sound.h" #include "BKE_tracking.h" @@ -1566,6 +1568,23 @@ void DepsgraphNodeBuilder::build_sound(bSound *sound) build_parameters(&sound->id); } +void DepsgraphNodeBuilder::build_sequencer(Scene *scene) +{ + if (scene->ed == NULL) { + return; + } + add_operation_node(&scene->id, NodeType::SEQUENCER, OperationCode::SEQUENCES_EVAL); + /* Make sure data for sequences is in the graph. */ + Sequence *seq; + SEQ_BEGIN (scene->ed, seq) { + if (seq->sound != NULL) { + build_sound(seq->sound); + } + /* TODO(sergey): Movie clip, scene, camera, mask. */ + } + SEQ_END; +} + /* **** ID traversal callbacks functions **** */ void DepsgraphNodeBuilder::modifier_walk(void *user_data, diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes.h b/source/blender/depsgraph/intern/builder/deg_builder_nodes.h index 68fb9ab6cc2..9805bd97b08 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_nodes.h +++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes.h @@ -208,6 +208,7 @@ class DepsgraphNodeBuilder : public DepsgraphBuilder { void build_lightprobe(LightProbe *probe); void build_speaker(Speaker *speaker); void build_sound(bSound *sound); + void build_sequencer(Scene *scene); /* Per-ID information about what was already in the dependency graph. * Allows to re-use certain values, to speed up following evaluation. */ diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes_view_layer.cc b/source/blender/depsgraph/intern/builder/deg_builder_nodes_view_layer.cc index 60b711d76d3..c03416e956e 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_nodes_view_layer.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes_view_layer.cc @@ -152,6 +152,10 @@ void DepsgraphNodeBuilder::build_view_layer(Scene *scene, build_collection(NULL, fls->group); } } + /* Sequencer. */ + if (linked_state == DEG_ID_LINKED_DIRECTLY) { + build_sequencer(scene); + } /* Collections. */ add_operation_node( &scene->id, diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc index 242b78f1b8f..46d565ad190 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" @@ -2297,6 +2299,25 @@ void DepsgraphRelationBuilder::build_sound(bSound *sound) build_parameters(&sound->id); } +void DepsgraphRelationBuilder::build_sequencer(Scene *scene) +{ + if (scene->ed == NULL) { + return; + } + /* Make sure dependnecies from sequences data goes to the sequencer evaluation. */ + ComponentKey sequencer_key(&scene->id, NodeType::SEQUENCER); + Sequence *seq; + 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"); + } + /* TODO(sergey): Movie clip, scene, camera, mask. */ + } + SEQ_END; +} + void DepsgraphRelationBuilder::build_copy_on_write_relations() { for (IDNode *id_node : graph_->id_nodes) { diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.h b/source/blender/depsgraph/intern/builder/deg_builder_relations.h index e84bd857090..190b4064481 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_relations.h +++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.h @@ -41,6 +41,7 @@ #include "intern/builder/deg_builder_rna.h" #include "intern/depsgraph.h" #include "intern/node/deg_node.h" +#include "intern/node/deg_node_id.h" #include "intern/node/deg_node_component.h" #include "intern/node/deg_node_operation.h" @@ -195,7 +196,9 @@ class DepsgraphRelationBuilder : public DepsgraphBuilder { void build_id(ID *id); void build_layer_collections(ListBase *lb); - void build_view_layer(Scene *scene, ViewLayer *view_layer); + void build_view_layer(Scene *scene, + ViewLayer *view_layer, + eDepsNode_LinkedState_Type linked_state); void build_collection(LayerCollection *from_layer_collection, Object *object, Collection *collection); @@ -266,6 +269,7 @@ class DepsgraphRelationBuilder : public DepsgraphBuilder { void build_lightprobe(LightProbe *probe); void build_speaker(Speaker *speaker); void build_sound(bSound *sound); + void build_sequencer(Scene *scene); void build_nested_datablock(ID *owner, ID *id); void build_nested_nodetree(ID *owner, bNodeTree *ntree); diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations_view_layer.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations_view_layer.cc index a325544e046..8a23e4b9b6e 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_relations_view_layer.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_relations_view_layer.cc @@ -75,7 +75,9 @@ void DepsgraphRelationBuilder::build_layer_collections(ListBase *lb) } } -void DepsgraphRelationBuilder::build_view_layer(Scene *scene, ViewLayer *view_layer) +void DepsgraphRelationBuilder::build_view_layer(Scene *scene, + ViewLayer *view_layer, + eDepsNode_LinkedState_Type linked_state) { /* Setup currently building context. */ scene_ = scene; @@ -128,10 +130,14 @@ void DepsgraphRelationBuilder::build_view_layer(Scene *scene, ViewLayer *view_la build_collection(NULL, NULL, fls->group); } } + /* Sequencer. */ + if (linked_state == DEG_ID_LINKED_DIRECTLY) { + build_sequencer(scene); + } /* Build all set scenes. */ if (scene->set != NULL) { ViewLayer *set_view_layer = BKE_view_layer_default_render(scene->set); - build_view_layer(scene->set, set_view_layer); + build_view_layer(scene->set, set_view_layer, DEG_ID_LINKED_VIA_SET); } } |