Animating scene audio volume doesn't work #75686

Closed
opened 2020-04-13 17:55:22 +02:00 by ChristopherAnderssarian · 14 comments

Title: Animating scene audio volume dosn't work
System Information
Operating system: Windows 7
GPU: Radeon Vega 64, Divider version: 19.12.2
CPU: Intel Core i7-5960X

Blender Version(s)
(listed are versions tested)

Working: 2.79 (sub 00), branch: master, commit date: 2018-03-22 14:10, hash: f4dc9f9d68b, type: Release, build date: 2018-03-22, 09:59 AM
Broken: 2.80 (sub 75), branch: master, commit date: 2019-07-29 14:47, hash: f6cb5f54494e, type: Release, build date: 2019-07-29, 09:44 AM
Broken: 2.81 (sub 16), branch: master, commit date: 2019-11-20 14:27, hash: 26bd5ebd42e3, type: Release, build date: 2019-11-20, 16:33:00
Broken: 2.82 (sub 07), branch: master, commit date: 2020-02-12 16:20, hash: 77d23b0bd76f, type: Release, build date: 2020-02-13, 01:56:46
Broken: blender-2.83-2e75172c45fd-windows64 (build bot)

Short description of error
Animating scene audio volume doesn't affect the preview or render.

Exact steps for others to reproduce the error

Scene_Audio_keying.blend

Title: Animating scene audio volume dosn't work **System Information** Operating system: Windows 7 GPU: Radeon Vega 64, Divider version: 19.12.2 CPU: Intel Core i7-5960X **Blender Version(s)** *(listed are versions tested)* Working: `2.79 (sub 00), branch: master, commit date: 2018-03-22 14:10, hash: f4dc9f9d68b, type: Release, build date: 2018-03-22, 09:59 AM` Broken: ` 2.80 (sub 75), branch: master, commit date: 2019-07-29 14:47, hash: f6cb5f54494e, type: Release, build date: 2019-07-29, 09:44 AM` Broken: ` 2.81 (sub 16), branch: master, commit date: 2019-11-20 14:27, hash: 26bd5ebd42e3, type: Release, build date: 2019-11-20, 16:33:00` Broken: ` 2.82 (sub 07), branch: master, commit date: 2020-02-12 16:20, hash: 77d23b0bd76f, type: Release, build date: 2020-02-13, 01:56:46` Broken: `blender-2.83-2e75172c45fd-windows64` (build bot) **Short description of error** Animating scene audio volume doesn't affect the preview or render. **Exact steps for others to reproduce the error** [Scene_Audio_keying.blend](https://archive.blender.org/developer/F8469287/Scene_Audio_keying.blend)

Added subscriber: @ChristopherAnderssarian

Added subscriber: @ChristopherAnderssarian
Member

Added subscriber: @lichtwerk

Added subscriber: @lichtwerk
Member

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'
Member

Can confirm.
Manually editing the scene audio volume works, doing this with keyframes doesnt.

Not quite sure why this is set to Low priority? Would actually set this to High instead (seems quite important, no?)...

Can confirm. Manually editing the scene audio volume works, doing this with keyframes doesnt. Not quite sure why this is set to Low priority? Would actually set this to High instead (seems quite important, no?)...

I used the wrong phab link, apologies. With the amount of reports I've submitted being deemed low priority I assumed this to be a "obscure workflow", but having said that; thanks for the triage!

I used the wrong phab link, apologies. With the amount of reports I've submitted being deemed low priority I assumed this to be a "obscure workflow", but having said that; thanks for the triage!
Sybren A. Stüvel self-assigned this 2020-04-14 16:12:51 +02:00
Member

Added subscriber: @Sergey

Added subscriber: @Sergey
Member

After all this time, I am still confused about our animation system and dependency graph...

So Animation seems to be correctly executed:

  • BKE_animsys_eval_animdata
  • BKE_animsys_write_rna_setting
  • RNA_property_float_set
  • fprop->set

all seem to do their thing...

For the property_update (rna_Scene_volume_update) , this is set up to tag the scene with ID_RECALC_AUDIO_VOLUME, however in BKE_scene_update_sound [which is constantly called] this recalc flag doesnt seem to be set on the evaluated scene... so BKE_sound_set_scene_volume isnt called...

I feel dumb, why is this so? Maybe @dr.sybren or @Sergey would know...

After all this time, I am still confused about our animation system and dependency graph... So Animation seems to be correctly executed: - BKE_animsys_eval_animdata - BKE_animsys_write_rna_setting - RNA_property_float_set - fprop->set all seem to do their thing... For the property_update (`rna_Scene_volume_update`) , this is set up to tag the scene with `ID_RECALC_AUDIO_VOLUME`, however in `BKE_scene_update_sound` [which is constantly called] this recalc flag doesnt seem to be set on the evaluated scene... so `BKE_sound_set_scene_volume` isnt called... I feel dumb, why is this so? Maybe @dr.sybren or @Sergey would know...
Member

On the sideline:
Was wondering if this should be removed?
6a392e8cb5

Was disabled / removed in
b062056c05, 21744217ce

On the sideline: Was wondering if this should be removed? 6a392e8cb5 Was disabled / removed in b062056c05, 21744217ce

This issue was referenced by 6adb254bb0

This issue was referenced by 6adb254bb046ab337cfd4225ca55e17f196db312

@lichtwerk, noit sure what exactly you mean. The mechanism where graph evaluation tags graph for updates (aka animation system using update callback) is very weak and fragile.

For the original report what we can do is to introduce dedicated audio properties which will assign recalc flags on the evaluated scene, similar to how it's done for individual particle systems which then gets handled by a more "uber" update function.

@lichtwerk, noit sure what exactly you mean. The mechanism where graph evaluation tags graph for updates (aka animation system using update callback) is very weak and fragile. For the original report what we can do is to introduce dedicated audio properties which will assign recalc flags on the evaluated scene, similar to how it's done for individual particle systems which then gets handled by a more "uber" update function.
Member

In #75686#910185, @Sergey wrote:
@lichtwerk, noit sure what exactly you mean. The mechanism where graph evaluation tags graph for updates (aka animation system using update callback) is very weak and fragile.

I meant removing all traces to the old code, see D7432: Cleanup: remove (unused) RNA update cache

> In #75686#910185, @Sergey wrote: > @lichtwerk, noit sure what exactly you mean. The mechanism where graph evaluation tags graph for updates (aka animation system using update callback) is very weak and fragile. I meant removing all traces to the old code, see [D7432: Cleanup: remove (unused) RNA update cache](https://archive.blender.org/developer/D7432)

In #75686#910185, @Sergey wrote:
For the original report what we can do is to introduce dedicated audio properties which will assign recalc flags on the evaluated scene, similar to how it's done for individual particle systems which then gets handled by a more "uber" update function.

How would you design such dedicated audio properties? How would it differ from the tagging that's done in D7429 in rna_Scene_use_audio_set()?

> In #75686#910185, @Sergey wrote: > For the original report what we can do is to introduce dedicated audio properties which will assign recalc flags on the evaluated scene, similar to how it's done for individual particle systems which then gets handled by a more "uber" update function. How would you design such dedicated audio properties? How would it differ from the tagging that's done in [D7429](https://archive.blender.org/developer/D7429) in `rna_Scene_use_audio_set()`?

How would you design such dedicated audio properties?

  1. Add OperationCode::AUDIO_VOLUME operation to NodeType::AUDIO component with the callback which is explained in a bit.
  2. Add relation from OperationCode::AUDIO_VOLUME to OperationCode::SOUND_EVAL.
  3. Add relation from animation to OperationCode::AUDIO_VOLUME if the volume is animated

The callback for OperationCode::AUDIO_VOLUME would set a flag in the actual scene which needs this. It can set the same ID_RECALC_AUDIO_VOLUME.

Currently the sound is updated in BKE_scene_update_sound from either scene_graph_update_tagged or from BKE_scene_graph_update_for_newframe. This means, that doing that simple edit should be enough to get things going. In a longer perspective the BKE_scene_update_sound should be done as OperationCode::SOUND_EVAL callback, and also incorporate sequencer sound update.

How would it differ from the tagging that's done in D7429 in rna_Scene_use_audio_set()

It will differ in a sense that it will not violate the law [insert the cut from Kung Fury where he tells Cobra he is under arrest for breaking the law].

  • The RNA is designed in a way that set() is only responsible for modifying value in DNA. Tagging should be happening from update().
  • Doing dependency graph tagging during evaluation is meaningless. It might work in this simple case and at the current state of code. It will break when sound evaluation is properly moved as a dependency graph evaluation operation.
  • Dependency graph tag notifies all dependency graphs about the change, and you obviously don't want this to happen from inside some random dependency graph evaluation.
> How would you design such dedicated audio properties? 1. Add `OperationCode::AUDIO_VOLUME` operation to `NodeType::AUDIO` component with the callback which is explained in a bit. 2. Add relation from `OperationCode::AUDIO_VOLUME` to `OperationCode::SOUND_EVAL`. 3. Add relation from animation to `OperationCode::AUDIO_VOLUME` if the volume is animated The callback for `OperationCode::AUDIO_VOLUME` would set a flag in the actual scene which needs this. It can set the same `ID_RECALC_AUDIO_VOLUME`. Currently the sound is updated in `BKE_scene_update_sound` from either `scene_graph_update_tagged` or from `BKE_scene_graph_update_for_newframe`. This means, that doing that simple edit should be enough to get things going. In a longer perspective the `BKE_scene_update_sound` should be done as `OperationCode::SOUND_EVAL` callback, and also incorporate sequencer sound update. > How would it differ from the tagging that's done in [D7429](https://archive.blender.org/developer/D7429) in `rna_Scene_use_audio_set()` It will differ in a sense that it will not violate the law *[insert the cut from Kung Fury where he tells Cobra he is under arrest for breaking the law]*. - The RNA is designed in a way that `set()` is only responsible for modifying value in DNA. Tagging should be happening from `update()`. - Doing dependency graph tagging during evaluation is meaningless. It might work in this simple case and at the current state of code. It will break when sound evaluation is properly moved as a dependency graph evaluation operation. - Dependency graph tag notifies all dependency graphs about the change, and you obviously don't want this to happen from inside some random dependency graph evaluation.

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
Thomas Dinges added this to the 2.83 LTS milestone 2023-02-08 16:38:05 +01:00
Sign in to join this conversation.
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 project
No Assignees
5 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#75686
No description provided.