Sequencer: Add Scene Strip Volume property #112597

Merged
Richard Antalik merged 6 commits from 20kdc/blender:scene-audio-strip-precision into main 2023-11-21 08:09:31 +01:00
Contributor

Problem

Presently, it is not possible to alter a scene strip's volume independent of that scene.

Case A

This can be annoying if, for example, there is contextual audio involved that should not always be present, or would be duplicated, in the outer scene.

Take as an example a music-synced production prepared in the Sequencer. The scenes may look like this:

  • Video (MainWork, then EndCard)
  • MainWork (various 3D scenes and sequencer business, along with the actual audio)
  • Credits (refers to MainWork, but silently, while having separate audio)

Credits may even refer to MainWork multiple times at different points, which would cause duplicated audio.

However, while editing MainWork, the audio is important for synchronization. In addition, some 3D scenes may be "built around" specific musical moments and thus carry their own references to the music.

Case B

Keyframing scene volume from a Sequencer scene strip does not act in an "unsurprising" way.

My tests on Blender 3.6 and main (as of the base commit of this PR) indicate that the keyframes are in fact added, but they are added on the timeline of the target scene, without accounting for the frame offset / etc. Seeking produces nearly no feedback whatsoever, except the possible lighting of the keyframe indicator.

Proposal

The property to directly control scene strip volume exists, and in my testing, works fine including animation.

As such, exposing this property and adding UI for it should solve the problem. (I have yet to test pan, see TODO)

Notably, this only required exposing the data in RNA and UI. It doesn't alter sequencer.cc or such. (It also appears that someone had already been laying the groundwork for this change there.)

Alternatives

  • It may be a potential idea to have a method of marking a strip as "not visible from outside". This doesn't help if trying to keyframe volume, but would generally allow for (for example) in-VSE "helper sounds" to be suppressed while allowing sound effects to remain exported.
  • A "Volume Control" effect strip would allow for a more general-purpose approach to managing sound volume. (Apparently, as of very recently, an "Equalizer" strip modifier has been added. However, this modifier can't be applied to scene strip audio.)
  • Volume/pan control may be merged into the basic set of strip attributes in the same way that Transform has been.

Limitations

  • It is possible that there are side effects to this implementation that I am not aware of, i.e. some situation in which the audio will not properly handle the "recursive multiplication". However, it seems that the Sequencer audio implementation is a relatively consistent "audio graph", and testing hasn't shown any issues, so I don't think this is likely.

User Interface

The current UI retains Scene Volume for compatibility, but adds Strip Volume in a separate panel.

image

TODO

  • I'm unsure of how to add panning into this nicely, as the Sound Strip code from which this is sourced (in scripts/startup/bl_ui/space_sequencer.py) is both unspecific enough to be kind of a duplication and also specific enough for deduplication to be difficult. A particularly acute problem is that scenes are not necessarily mono, so the effects are uncertain.
    • Answer: Panning doesn't work for scene strips anyway. Therefore exposing it from the RNA was removed from the PR as of b232a17c5e .
  • Animated scene strip volume does not update the UI properly, though this also applies to other properties such as the transform.
    • This kind of seems like it's the result of something elsewhere.
  • There may be particularly nebulous reasons not to do this that I am not aware of.
    • Nobody has brought any up.
  • Given that animated scene volume (as opposed to strip volume) from the VSE appears to not function in any expected way, it may be an idea to remove it entirely. The property still exists at its regular location as part of a Scene's properties.
    • Done
  • Figure out what Failed to add relation "Sequence Scene Audio -> Sequencer" and Could not find op_from: ComponentKey(SCScene.001, AUDIO) are about. Part of an unrelated, separate issue.
## Problem Presently, it is not possible to alter a scene strip's volume independent of that scene. ### Case A This can be annoying if, for example, there is contextual audio involved that should not always be present, or would be duplicated, in the outer scene. Take as an example a music-synced production prepared in the Sequencer. The scenes may look like this: * Video (MainWork, then EndCard) * MainWork (various 3D scenes and sequencer business, along with the actual audio) * Credits (refers to MainWork, but silently, while having separate audio) Credits may even refer to MainWork multiple times at different points, which would cause duplicated audio. However, while editing MainWork, the audio is important for synchronization. In addition, some 3D scenes may be "built around" specific musical moments and thus carry their own references to the music. ### Case B Keyframing scene volume from a Sequencer scene strip does not act in an "unsurprising" way. My tests on Blender 3.6 and main (as of the base commit of this PR) indicate that the keyframes are in fact added, but they are added on the timeline of the target scene, without accounting for the frame offset / etc. Seeking produces nearly no feedback whatsoever, except the possible lighting of the keyframe indicator. ## Proposal The property to directly control scene strip volume exists, and in my testing, works fine including animation. As such, exposing this property and adding UI for it should solve the problem. (I have yet to test pan, see TODO) Notably, this only required exposing the data in RNA and UI. It doesn't alter `sequencer.cc` or such. (It also appears that someone had already been laying the groundwork for this change there.) ## Alternatives * It may be a potential idea to have a method of marking a strip as "not visible from outside". This doesn't help if trying to keyframe volume, but would generally allow for (for example) in-VSE "helper sounds" to be suppressed while allowing sound effects to remain exported. * A "Volume Control" effect strip would allow for a more general-purpose approach to managing sound volume. (Apparently, as of very recently, an "Equalizer" strip modifier has been added. However, this modifier can't be applied to scene strip audio.) * Volume/pan control may be merged into the basic set of strip attributes in the same way that Transform has been. ## Limitations * It is possible that there are side effects to this implementation that I am not aware of, i.e. some situation in which the audio will not properly handle the "recursive multiplication". However, it seems that the Sequencer audio implementation is a relatively consistent "audio graph", and testing hasn't shown any issues, so I don't think this is likely. ## User Interface The current UI retains Scene Volume for compatibility, but adds Strip Volume in a separate panel. ![image](/attachments/e6b44c68-7504-4132-9896-93b1d358f7fa) ## TODO * ~~I'm unsure of how to add panning into this nicely, as the Sound Strip code from which this is sourced (in `scripts/startup/bl_ui/space_sequencer.py`) is both unspecific enough to be kind of a duplication and also specific enough for deduplication to be difficult. A particularly acute problem is that scenes are not necessarily mono, so the effects are uncertain.~~ * Answer: Panning doesn't work for scene strips anyway. Therefore exposing it from the RNA was removed from the PR as of b232a17c5eb7877b6e4a63cceea5cce616f26df8 . * Animated scene strip volume does not update the UI properly, though this also applies to other properties such as the transform. * This kind of seems like it's the result of something elsewhere. * There may be particularly nebulous reasons *not* to do this that I am not aware of. * Nobody has brought any up. * ~~Given that animated scene volume (as opposed to strip volume) from the VSE appears to not function in any expected way, it may be an idea to remove it entirely. The property still exists at its regular location as part of a Scene's properties.~~ * Done * ~~Figure out what `Failed to add relation "Sequence Scene Audio -> Sequencer"` and `Could not find op_from: ComponentKey(SCScene.001, AUDIO)` are about.~~ Part of an unrelated, separate issue.
20kdc added 2 commits 2023-09-19 20:17:22 +02:00
Iliya Katushenock added the
Interest
Video Sequencer
label 2023-09-19 20:20:08 +02:00
Author
Contributor

So it seems that the Failed to add relation "Sequence Scene Audio -> Sequencer" stuff is a part of an issue (69444) which I am definitely not qualified to tackle. I guess I'll remove it from the TODO?

So it seems that the `Failed to add relation "Sequence Scene Audio -> Sequencer"` stuff is a part of an issue (69444) which I am definitely not qualified to tackle. I guess I'll remove it from the TODO?
Iliya Katushenock added this to the Video Sequencer project 2023-10-13 15:57:32 +02:00

Thanks for patch, I think this could work. Personally I would draw sound panel as for sound strip if this is done and leave scene panel as is. As for equalizer modifier, this could also work on scene strips, but it has to be allowed in relevant poll functions, possibly generalize polls to strip having sound. If you can test whether all sound features like panning works well I think this would be fine to merge.

Seems, that you are already aware of issues like #69444 and #70569. These would not be related to this implementation as evaluation is done on active scene level. But it is something that is not implemented well currently. I would love to address this issue, but I think it will require quite significant time investment, and it is not really on list of priorities now.
That said, I don't think this patch would be a fix for broken nested scene sound evaluation.

Thanks for patch, I think this could work. Personally I would draw sound panel as for sound strip if this is done and leave scene panel as is. As for equalizer modifier, this could also work on scene strips, but it has to be allowed in relevant poll functions, possibly generalize polls to strip having sound. If you can test whether all sound features like panning works well I think this would be fine to merge. Seems, that you are already aware of issues like #69444 and #70569. These would not be related to this implementation as evaluation is done on active scene level. But it is something that is not implemented well currently. I would love to address this issue, but I think it will require quite significant time investment, and it is not really on list of priorities now. That said, I don't think this patch would be a fix for broken nested scene sound evaluation.
Author
Contributor

Merging the UI into SEQUENCER_PT_adjust_sound seems like it'd make a mess of things, since it checks for a bunch of sound-strip-specific stuff (i.e. Use Mono) and those checks need to be bypassed.

In any case panning appears to do nothing in actual practice (presumably scene mixing is always stereo even if the output type is not).

(EDIT: Strip, not scene!) volume, as previously tested, works fine.

Merging the UI into `SEQUENCER_PT_adjust_sound` seems like it'd make a mess of things, since it checks for a bunch of sound-strip-specific stuff (i.e. Use Mono) and those checks need to be bypassed. In any case panning appears to do nothing in actual practice (presumably scene mixing is always stereo even if the output type is not). (EDIT: Strip, not scene!) volume, as previously tested, works fine.
20kdc added 1 commit 2023-10-28 12:19:59 +02:00

Having strip related properties in the Scene Panel is misleading.

The patch is in the draft state, which means we do not typically look into those. If you think patch is finished and is ready for review please remove the WIP status.

Having strip related properties in the Scene Panel is misleading. The patch is in the draft state, which means we do not typically look into those. If you think patch is finished and is ready for review please remove the WIP status.
20kdc added 1 commit 2023-11-20 01:03:44 +01:00
20kdc changed title from WIP: Sequencer: Add Scene Strip Volume property to Sequencer: Add Scene Strip Volume property 2023-11-20 01:06:06 +01:00
20kdc added 1 commit 2023-11-20 01:09:39 +01:00
Author
Contributor

Having strip related properties in the Scene Panel is misleading.

The patch is in the draft state, which means we do not typically look into those. If you think patch is finished and is ready for review please remove the WIP status.

After adjusting UI (see newly updated screenshot), I've dropped the WIP status since it doesn't seem like there's anything else to do.

I do wonder if maybe I should squish the commits to just have the RNA and UI commits though.

> Having strip related properties in the Scene Panel is misleading. > > The patch is in the draft state, which means we do not typically look into those. If you think patch is finished and is ready for review please remove the WIP status. After adjusting UI (see newly updated screenshot), I've dropped the WIP status since it doesn't seem like there's anything else to do. I do wonder if maybe I should squish the commits to just have the RNA and UI commits though.

I have quickly checked whether pan would work with scene strip, but it doesn't, so I guess it would require some additional work. Technically even waveform drawing would be possible to do, not sure how useful it would be though. My idea was to make these properties work so that panel could be reused. Unfortunately I don't have much time to look into this myself. Also don't think it is necesary for goal of this patch.

I have quickly checked whether pan would work with scene strip, but it doesn't, so I guess it would require some additional work. Technically even waveform drawing would be possible to do, not sure how useful it would be though. My idea was to make these properties work so that panel could be reused. Unfortunately I don't have much time to look into this myself. Also don't think it is necesary for goal of this patch.
Richard Antalik requested changes 2023-11-20 06:36:51 +01:00
Richard Antalik left a comment
Member

I think, that scene audio_volume property should be removed, as this is not strip property, and having 2 volume properties is confusing.

I think, that scene `audio_volume` property should be removed, as this is not strip property, and having 2 volume properties is confusing.
20kdc added 1 commit 2023-11-20 21:32:47 +01:00
Author
Contributor

I think, that scene audio_volume property should be removed, as this is not strip property, and having 2 volume properties is confusing.

Done! (This was one of the things I mentioned in the TODO but wanted someone to OK it first)

> I think, that scene `audio_volume` property should be removed, as this is not strip property, and having 2 volume properties is confusing. Done! (This was one of the things I mentioned in the TODO but wanted someone to OK it first)
Richard Antalik approved these changes 2023-11-21 08:05:05 +01:00
Richard Antalik left a comment
Member

LGTM now. Thanks.

LGTM now. Thanks.
Richard Antalik merged commit f01c82e268 into main 2023-11-21 08:09:31 +01:00
Sign in to join this conversation.
No reviewers
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#112597
No description provided.