Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSybren A. Stüvel <sybren@blender.org>2020-04-14 20:22:18 +0300
committerSybren A. Stüvel <sybren@blender.org>2020-04-17 17:33:05 +0300
commit6adb254bb046ab337cfd4225ca55e17f196db312 (patch)
tree6a568097a02fdd700123ec1411f6b1169a99c6df /source/blender/depsgraph/intern
parent27941b027b245e4814074698a9bdc193a8d0a0d3 (diff)
Fix T75686: Animating scene audio volume doesn't work
Scene audio volume changes require the scene to be tagged with `ID_RECALC_AUDIO_VOLUME` (see `BKE_scene_update_sound()`). Tagging happens in the RNA update function `rna_Scene_volume_update()`, but that function is not called by the animation system. As a result, animated volume changes are not sent to the audio system. This commit adds a new depsgraph operation node that sets this tag when necessary, so that the animated values are used in the rest of the depsgraph evaluation. Reviewed By: sergey Differential Revision: https://developer.blender.org/D7429
Diffstat (limited to 'source/blender/depsgraph/intern')
-rw-r--r--source/blender/depsgraph/intern/builder/deg_builder_nodes.cc7
-rw-r--r--source/blender/depsgraph/intern/builder/deg_builder_relations.cc10
-rw-r--r--source/blender/depsgraph/intern/node/deg_node_operation.cc2
-rw-r--r--source/blender/depsgraph/intern/node/deg_node_operation.h1
4 files changed, 19 insertions, 1 deletions
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
index 04333dbd038..0adea027ecc 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
@@ -1736,7 +1736,14 @@ void DepsgraphNodeBuilder::build_scene_audio(Scene *scene)
if (built_map_.checkIsBuiltAndTag(scene, BuilderMap::TAG_SCENE_AUDIO)) {
return;
}
+
add_operation_node(&scene->id, NodeType::AUDIO, OperationCode::SOUND_EVAL);
+
+ Scene *scene_cow = get_cow_datablock(scene);
+ add_operation_node(&scene->id,
+ NodeType::AUDIO,
+ OperationCode::AUDIO_VOLUME,
+ function_bind(BKE_scene_update_tag_audio_volume, _1, scene_cow));
}
void DepsgraphNodeBuilder::build_scene_speakers(Scene * /*scene*/, ViewLayer *view_layer)
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
index 89def9e0bdc..e968ad1ea5d 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
@@ -2544,8 +2544,16 @@ void DepsgraphRelationBuilder::build_scene_sequencer(Scene *scene)
}
}
-void DepsgraphRelationBuilder::build_scene_audio(Scene * /*scene*/)
+void DepsgraphRelationBuilder::build_scene_audio(Scene *scene)
{
+ OperationKey scene_audio_volume_key(&scene->id, NodeType::AUDIO, OperationCode::AUDIO_VOLUME);
+ OperationKey scene_sound_eval_key(&scene->id, NodeType::AUDIO, OperationCode::SOUND_EVAL);
+ add_relation(scene_audio_volume_key, scene_sound_eval_key, "Audio Volume -> Sound");
+
+ if (scene->audio.flag & AUDIO_VOLUME_ANIMATED) {
+ ComponentKey scene_anim_key(&scene->id, NodeType::ANIMATION);
+ add_relation(scene_anim_key, scene_audio_volume_key, "Animation -> Audio Volume");
+ }
}
void DepsgraphRelationBuilder::build_scene_speakers(Scene * /*scene*/, ViewLayer *view_layer)
diff --git a/source/blender/depsgraph/intern/node/deg_node_operation.cc b/source/blender/depsgraph/intern/node/deg_node_operation.cc
index 78399d5c953..1e03d51f557 100644
--- a/source/blender/depsgraph/intern/node/deg_node_operation.cc
+++ b/source/blender/depsgraph/intern/node/deg_node_operation.cc
@@ -61,6 +61,8 @@ const char *operationCodeAsString(OperationCode opcode)
/* Scene related. */
case OperationCode::SCENE_EVAL:
return "SCENE_EVAL";
+ case OperationCode::AUDIO_VOLUME:
+ return "AUDIO_VOLUME";
/* Object related. */
case OperationCode::OBJECT_BASE_FLAGS:
return "OBJECT_BASE_FLAGS";
diff --git a/source/blender/depsgraph/intern/node/deg_node_operation.h b/source/blender/depsgraph/intern/node/deg_node_operation.h
index bdc0df7f399..2faf139ec93 100644
--- a/source/blender/depsgraph/intern/node/deg_node_operation.h
+++ b/source/blender/depsgraph/intern/node/deg_node_operation.h
@@ -60,6 +60,7 @@ enum class OperationCode {
/* Scene related. ------------------------------------------------------- */
SCENE_EVAL,
+ AUDIO_VOLUME,
/* Object related. ------------------------------------------------------ */
OBJECT_BASE_FLAGS,