godotengine / godot-proposals

Godot Improvement Proposals (GIPs)
MIT License
1.13k stars 86 forks source link

Inserting a bezier keyframe on top of an existing one should retain In/Out handles rather than resetting handles to default. #9727

Closed ImpishOaths closed 1 month ago

ImpishOaths commented 4 months ago

Describe the project you are working on

A 3D Hack & Slash using 2D sprite characters. My game uses a lot of very quick, bezier-driven animations.

Describe the problem or limitation you are having in your project

Currently when inserting a keyframe to replace an existing keyframe, the bezier keyframe's In/Out handles get reset to the default values of (-0.25,0) and (0.25,0). Whenever I overwrite an existing keyframe I have to go in and correct the handles back to what I want them to be which is very annoying. Video showing the problem:

https://github.com/godotengine/godot-proposals/assets/140586944/a5fcd6ec-aada-44b5-8da0-0941756c2dc3

Describe the feature / enhancement and how it helps to overcome the problem or limitation

Simply keep the existing Bezier In/Out handles when updating an existing keyframe rather than resetting them to default. This does not impact inserting a keyframe at a time that doesn't already have a keyframe (that still gives default In/Out handles). This also does not impact copy/pasting/duplicating keyframes because that doesn't reset handles to default anyway.

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

I have already implemented a solution here https://github.com/godotengine/godot/commit/cdbf389820732c2cc6700c6e06474cb6ae4b589a Video of solution working:

https://github.com/godotengine/godot-proposals/assets/140586944/3fe05e94-4d42-4481-8b53-0765034038a9

If this enhancement will not be used often, can it be worked around with a few lines of script?

Because it's a modification of the animation player's behavior, it cannot be modified with a script.

Is there a reason why this should be core and not an add-on in the asset library?

Because it's a modification of the animation player's behavior, it cannot be modified with an asset library add-on.

ImpishOaths commented 4 months ago

Here's the pull request for this https://github.com/godotengine/godot/pull/91854