godotengine / godot-proposals

Godot Improvement Proposals (GIPs)
MIT License
1.12k stars 69 forks source link

Add animation/keyframe support for Audio Bus / Audio Effects #340

Open sampengilly opened 4 years ago

sampengilly commented 4 years ago

Describe the project you are working on: Environmental Storytelling type game

Describe the problem or limitation you are having in your project: Audio Bus / Audio Effect properties cannot be keyframed in the animation editor. Obvious workarounds exist such as making changes to those properties in code. However this approach is clunky if you're trying to tie audio element volumes or effect properties to other animated elements (such as transforms or shader property animations)

Describe how this feature / enhancement will help you overcome this problem or limitation: By treating audio bus volumes or audio effect properties as key-able values, a more coherent animation workflow can be achieved, combining spatial, visual, and aural elements on a single timeline. It feels a bit more consistent as well to allow all inspector properties to be keyframed in some way.

Show a mock up screenshots/video or a flow diagram explaining how your proposal will work: The "key" button as seen alongside other properties should be applied to audio effect properties and to audio bus volumes

image image image

Describe implementation detail for your proposal (in code), if possible: I'm not yet knowledgeable on the internals of the Godot engine and I imagine that the reason this feature doesn't already exist is possibly due to audio properties not being treated in the same "named" (i.e. indexable path) fashion as other properties such as .:material:shader_param/blur_amount. I would imagine that if these properties were handled in such an indexable way, a simple UI fix would be all that is needed.

If this enhancement will not be used often, can it be worked around with a few lines of script?: As stated above, this can be worked around but leads to a disjointed and clunky workflow when animating things that contain both visual and aural elements/effects that change over time.

Is there a reason why this should be core and not an add-on in the asset library?: I don't know that I'm qualified enough to state with certainty whether this particular feature could be implemented as a plugin or not. That being said, I feel as though the indexing of properties for animation purposes is something baked into the core of Godot and would certainly make sense to be implemented in the core.

sampengilly commented 4 years ago

I've taken a bit of a look at the editor code to try and gain an understanding of what's involved. Since currently every type of Animation Track is based upon a Node, there might be a bit of work involved in creating a new Animation Track type that isn't based upon a Node but is instead based upon a selected Bus. Either that or some other rejig of the audio system to make Buses more Node-like or to allow their properties to be seen in the properties list of AudioStreamPlayer Nodes

s9menine commented 4 years ago

Adding my support! Being able to directly animate bus properties and effect properties would make trying to add features such as FMOD's mixer snapshots or WWise's mixer states into a game much more feasible. In the meantime, @fire has found a workaround which I wrote on here, but there are limitations: https://godotengine.org/qa/32054/how-to-animate-properties-of-an-audioeffect

sampengilly commented 4 years ago

I did discover that this applies to a number of other properties. For example, font size in Control nodes, the animation tool has access to various font properties, but some properties like font size are wrapped up in the font object. When adding keyframes for the font object, it doesn't tween the properties within the font object, instead it changes instantaneously upon reaching the keyframe

seocwen commented 2 years ago

I note that there is currently a bit of a workaround for this: https://godotengine.org/qa/32054/how-to-animate-properties-of-an-audioeffect

The biggest problem I have with it, however, is that there's no way to preview the audio effects in the editor, which is part of what animations are for.