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:
authorSergey Sharybin <sergey.vfx@gmail.com>2019-06-07 11:58:51 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2019-06-07 12:59:30 +0300
commitd4a5691d0fd5be0517968a95ebbe84778fb82b3a (patch)
treeeddccb178b05884bcbb03a3dbf1396093d053bc2 /source/blender/blenkernel/intern
parent6e65cd86c3d8476051ef8f0ab53b2d639311e192 (diff)
Sound: Use dependency graph instead of bmain
Allows to move scene sound update to dependency graph evaluation.
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r--source/blender/blenkernel/intern/scene.c2
-rw-r--r--source/blender/blenkernel/intern/sound.c16
2 files changed, 5 insertions, 13 deletions
diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c
index 9fcbf209cba..350b046e54d 100644
--- a/source/blender/blenkernel/intern/scene.c
+++ b/source/blender/blenkernel/intern/scene.c
@@ -1527,7 +1527,7 @@ static void scene_update_sound(Depsgraph *depsgraph, Main *bmain)
if (recalc & ID_RECALC_AUDIO_LISTENER) {
BKE_sound_update_scene_listener(scene);
}
- BKE_sound_update_scene(bmain, scene);
+ BKE_sound_update_scene(depsgraph, scene);
}
/* TODO(sergey): This actually should become view_layer_graph or so.
diff --git a/source/blender/blenkernel/intern/sound.c b/source/blender/blenkernel/intern/sound.c
index 13aedf60cd0..eeef658c064 100644
--- a/source/blender/blenkernel/intern/sound.c
+++ b/source/blender/blenkernel/intern/sound.c
@@ -57,6 +57,7 @@
#include "BKE_scene.h"
#include "DEG_depsgraph.h"
+#include "DEG_depsgraph_query.h"
#ifdef WITH_AUDASPACE
/* evil globals ;-) */
@@ -940,12 +941,6 @@ static void sound_update_base(Scene *scene, Base *base, void *new_set)
sound_verify_evaluated_id(&scene->id);
sound_verify_evaluated_id(&ob->id);
- // TODO(sergey): Bring the test back, or make it a part of dependency graph update.
- // if ((ob->id.tag & LIB_TAG_DOIT) == 0) {
- // return;
- // }
- // ob->id.tag &= ~LIB_TAG_DOIT;
-
if ((ob->type != OB_SPEAKER) || !ob->adt) {
return;
}
@@ -1005,7 +1000,7 @@ static void sound_update_base(Scene *scene, Base *base, void *new_set)
}
}
-void BKE_sound_update_scene(Main *bmain, Scene *scene)
+void BKE_sound_update_scene(Depsgraph *depsgraph, Scene *scene)
{
sound_verify_evaluated_id(&scene->id);
@@ -1017,10 +1012,7 @@ void BKE_sound_update_scene(Main *bmain, Scene *scene)
float quat[4];
/* cheap test to skip looping over all objects (no speakers is a common case) */
- if (!BLI_listbase_is_empty(&bmain->speakers)) {
- // TODO(sergey): Bring the test back, or make it a part of dependency graph update.
- // BKE_main_id_tag_listbase(&bmain->objects, LIB_TAG_DOIT, true);
-
+ if (DEG_id_type_any_exists(depsgraph, ID_SPK)) {
for (ViewLayer *view_layer = scene->view_layers.first; view_layer;
view_layer = view_layer->next) {
for (base = view_layer->object_bases.first; base; base = base->next) {
@@ -1181,7 +1173,7 @@ void BKE_sound_set_cfra(int UNUSED(cfra))
void BKE_sound_update_sequencer(Main *UNUSED(main), bSound *UNUSED(sound))
{
}
-void BKE_sound_update_scene(Main *UNUSED(bmain), Scene *UNUSED(scene))
+void BKE_sound_update_scene(Depsgraph *UNUSED(depsgraph), Scene *UNUSED(scene))
{
}
void BKE_sound_update_scene_sound(void *UNUSED(handle), bSound *UNUSED(sound))