Page MenuHome

[WIP] Fix T70569: Scene strip content volume is not evaluated
AbandonedPublic

Authored by Richard Antalik (ISS) on Jan 7 2021, 12:09 PM.

Details

Summary

BKE_scene_eval_sequencer_sequences() did not evaluate sound strip volume inside scene strips.

Recurse into scene strips and evaluate their content with appropriate time.

Handling this through dependency graph would result in dependency loop. So the question here is whether we want to support this or not.
I think this is basic and essential functionality, so we should support this case

This is visualization of the problem (not accurate):

TODO:

  • check if this is even acceptable approach
  • Sound volume is not evaluated at all if scene doesn't contain any animation.
  • More testing. There may be cases where this can cause problems.

Diff Detail

Repository
rB Blender
Branch
T70569 (branched from master)
Build Status
Buildable 12030
Build 12030: arc lint + arc unit

Event Timeline

Richard Antalik (ISS) requested review of this revision.Jan 7 2021, 12:09 PM
Richard Antalik (ISS) edited the summary of this revision. (Show Details)Jan 8 2021, 6:16 AM
Sergey Sharybin (sergey) requested changes to this revision.Jan 18 2021, 3:17 PM

The audio operations and relations needs a pass of sanitization. It was not immediately clear, and was not documented in a design what is the designed order of updates.

Scenes have their own audio handles, so it should be possible to have scene to care about its strip locally, without need to do recursive updates.

If recursive updates are inevitable, it should also be reflected in the way how nodes and relations are constructed.

This revision now requires changes to proceed.Jan 18 2021, 3:17 PM

Scenes have their own audio handles, so it should be possible to have scene to care about its strip locally, without need to do recursive updates.

If recursive updates are inevitable, it should also be reflected in the way how nodes and relations are constructed.

Sound is not really problem here. Main issue with current implementation is that BKE_scene_eval_sequencer_sequences() does evaluate nested sound strips, but it doesn't do this with correct time value (nested scene frame is not set).
What VSE does here is similar to linking object with animation, but with time offset. So nested scene must be evaluated per each instance to get correct nested strip volume. I am not sure if there is similar feature implemented.

In any case this seems like non-trivial issue so perhaps I should re-classify bug to known issue?

During evaluation the following rule applies: never modify ID which is different from what is passed to the evaluation function. For example, modifier stack evaluation must not modify, say, boolean operand object. Read-only access to other IDs is fine if relations in the dependency graph ensures that Id is evaluated prior to access.

Currently, the BKE_scene_eval_sequencer_sequences evaluates sound which belongs to the scene which is passed as an argument. No recursion is happening, each scene is evaluated separately. This does follow regular ID evaluation from within dependency graph. Some tweaks might be needed to relations, nodes, order of evaluation, and maybe something else. But this patch is not correct because:

  • It seemingly goes into other IDs and modifies them during evaluation, which is forbidden.
  • It does re-evaluate animation, which must not be done outside of BKE_animsys_eval_animdata.

The issue here goes deeper, as there is no design about:

  • How 3D sound from scene used in a strip is supposed to be handled?
  • What if the same scene with strips and/or 3D sound is used multiple times via strip in the sequencer?

A lot of issues are coming from the change which allowed using nested strips from scene. This is very weak and I'd almost say that we should just remove this functionality, as it does not fit current design and causes a lot of user confusion.

In any case this seems like non-trivial issue so perhaps I should re-classify bug to known issue?

It is non-trivial indeed. The entire topics of sound, nested scene strips needs to have a concrete and solid design first. I'm not even sure we can solve possible regressions since 2.79 since back in those days dependency graph evaluation was violating the "loclaity" principle listed above, making things to be perceived as working, but causing all sort of threading issues.

Unless you see a very bad regression since 2.79 which can be solved in a way which does not violate design of dependency graph, I'm fine considering the report as known issue.

Unless you see a very bad regression since 2.79 which can be solved in a way which does not violate design of dependency graph, I'm fine considering the report as known issue.

Thanks so I am closing this revision and will reclassify report.