diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-05-01 16:57:16 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-05-03 16:50:40 +0300 |
commit | 6990ef151c199761da1eb1777ff384835bb7ba20 (patch) | |
tree | 2219af160a5f96ae1e4153a0365838efe78e0e91 /source/blender/blenkernel/intern/sound.c | |
parent | d02da8de23b1d5f64695d3e7e91384d5e2f24e4c (diff) |
Sound: Move evaluation to dependency graph
The sound handles are still in the original datablocks, so it's easier
to test since there should be no functional changes.
Diffstat (limited to 'source/blender/blenkernel/intern/sound.c')
-rw-r--r-- | source/blender/blenkernel/intern/sound.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/sound.c b/source/blender/blenkernel/intern/sound.c index 3b46677828d..18093173f7c 100644 --- a/source/blender/blenkernel/intern/sound.c +++ b/source/blender/blenkernel/intern/sound.c @@ -55,6 +55,9 @@ #include "BKE_sequencer.h" #include "BKE_scene.h" +#include "DEG_depsgraph.h" +#include "DEG_depsgraph_query.h" + #ifdef WITH_AUDASPACE /* evil globals ;-) */ static int sound_cfra; @@ -1183,3 +1186,15 @@ void BKE_sound_ensure_loaded(Main *bmain, bSound *sound) } BKE_sound_load(bmain, sound); } + +void BKE_sound_evaluate(Depsgraph *depsgraph, Main *bmain, bSound *sound) +{ + DEG_debug_print_eval(depsgraph, __func__, sound->id.name, sound); + /* TODO(sergey): For now we keep sound handlers in an original IDs, but it + * should really be moved to an evaluated one. */ + if (!DEG_is_active(depsgraph)) { + return; + } + bSound *sound_orig = (bSound *)DEG_get_original_id(&sound->id); + BKE_sound_ensure_loaded(bmain, sound_orig); +} |