Page MenuHome

WIP fix for missing updates when updating ID file paths.
ClosedPublic

Authored by Bastien Montagne (mont29) on Nov 16 2022, 5:16 PM.

Details

Summary

This code mainly tags IDs with ID_RECALC_SOURCE when one of their file
paths is modified by BKE_bpath_foreach_path_id.

In addition, a check is added to BKE_sound_evaluate to call similar
code as when ID_RECALC_AUDIO is used.

Finally, Sergey proposed some update to the depsgraph code itself.

However, sound is still not updating properly, even though manually
editing the path in the properties of the VSE strip (which uses RNA code
path, rna_Sound_update) does update sound as expected.

NOTE: WIP code with some debug code, also more ID types would likely need some update to their _evaluate functions? the only one actually taking ID_RECALC_SOURCE into account currently is the MovieClip type.

Ref T101326

Diff Detail

Repository
rB Blender

Event Timeline

Bastien Montagne (mont29) requested review of this revision.Nov 16 2022, 5:16 PM
Bastien Montagne (mont29) created this revision.

Applying this on top of this patch seems to make things work the way they expect to:

1diff --git a/source/blender/blenkernel/intern/sound.c b/source/blender/blenkernel/intern/sound.c
2index 3ec3f4246fe..a76fb098224 100644
3--- a/source/blender/blenkernel/intern/sound.c
4+++ b/source/blender/blenkernel/intern/sound.c
5@@ -1522,10 +1522,14 @@ void BKE_sound_jack_scene_update(Scene *scene, int mode, double time)
6 void BKE_sound_evaluate(Depsgraph *depsgraph, Main *bmain, bSound *sound)
7 {
8 DEG_debug_print_eval(depsgraph, __func__, sound->id.name, sound);
9- if (sound->id.recalc & (ID_RECALC_AUDIO | ID_RECALC_SOURCE)) {
10- if (sound->id.recalc & ID_RECALC_SOURCE) {
11- printf("%s IS TAGGED FOR RELOAD\n", sound->id.name);
12- }
13+
14+ if (sound->id.recalc & ID_RECALC_SOURCE) {
15+ /* Sequencer checks this flag to see if the strip sound is to be updated from the Audaspace
16+ * side. */
17+ sound->id.recalc |= ID_RECALC_AUDIO;
18+ }
19+
20+ if (sound->id.recalc & ID_RECALC_AUDIO) {
21 BKE_sound_load(bmain, sound);
22 return;
23 }

This revision was not accepted when it landed; it landed in state Needs Review.Nov 16 2022, 6:01 PM
This revision was automatically updated to reflect the committed changes.