Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add easier way to scale keyframes in AnimationPlayer Editor #3532

Open
mrkdji opened this issue Nov 11, 2021 · 8 comments
Open

Add easier way to scale keyframes in AnimationPlayer Editor #3532

mrkdji opened this issue Nov 11, 2021 · 8 comments

Comments

@mrkdji
Copy link

mrkdji commented Nov 11, 2021

Describe the project you are working on

I'm making a cutscene with the AnimationPlayer.

Describe the problem or limitation you are having in your project

The current way to scale keyframes in AnimationPlayer editor is cumbersome

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

Scale a selection of animation player keyframes by clicking Left Mouse Button on one of the selection extremities and eventually by holding a mouse modifier (for instance ALT).

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

It would be nice if the AnimationPlayer editor keyframes could be scaled like the notes in REAPER's MIDI editor

scale_notes

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

I'm not sure.

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

AnimationPlayer editor is core.

@vyshliy

This comment has been minimized.

@Calinou
Copy link
Member

Calinou commented Dec 12, 2021

@vyshliy Please don't bump issues without contributing significant new information. Use the 👍 reaction button on the first post instead.

@vyshliy
Copy link

vyshliy commented Jan 25, 2022

To be more specific. Blender has a convenient implementation of the proposed feature in terms of usability.

scale.frames.in.blender.mp4
  • Blender uses the mouse modifier "S" to scale frames in the animation tab that match the scale modifier in the other tabs.
  • Selected frames are scaled relative to an active frame allowing to scale from the desired position in the timeline, so there is no need to move the selected frames afterwards.
  • Negative scaling allows to mirror frames without any additional clicks.
  • Blender also allows to scale curve values together with the frame position, which may be related to Improve the animation Bezier editor #3141
scale.curves.in.blender.mp4

@hsandt
Copy link

hsandt commented Sep 2, 2023

Unity also has a nice way to represent this with vertical blue bars around the selected frames:

image

Source: https://docs.unity3d.com/Manual/animeditor-AdvancedKeySelectionAndManipulation.html

It is also used to move groups of keys (which Godot already supports, but instead of starting mouse drag from a specific key, you can start with the mouse cursor anywhere inside the selection box).

Note the final section about Ripple editing, a feature that allows to push non-selected keys while performing the Move or Scale operation. Certainly something we'll have to think of when implementing the Scale (and why not also Move, so we improve the existing one).

@viksl
Copy link

viksl commented Jun 7, 2024

So how exactly should this work? We could use hold button on frame and move around for scaling, we could also instead use S just like in Blender?

Keep in mind that this feature will also be used for bezier curve editor.

Personally I think S + just moving the mouse around and keeping the cursor captured for the editor window + wrapping would be fine. It would make it easier to use the wrap (since you don't need to hold the mouse button while moving the mouse around) and it feels a bit simpler to then lock the axis to X/Y in the bezier editor (just like in Blender) and use some numbers to move around (for example S + X + -1 to flip the keys.

Scaling towards what? Currently my suggestion is to always use the playhead as the reference. This means if playhead is at the first frame in the selection then the scaling scales around the played thus the first frame never moves, if it's at the end frame then the end frame stays at its position, and so on.

I'd like to see some specific info at this point, please. Come conclusion would be cool to have here ;).

@hsandt
Copy link

hsandt commented Jun 25, 2024

Just saw this other proposal to extend animation duration via mouse drag (#10030) and it occurred to me that we may also want to allow stretching keyframes beyond the max duration, automatically extending the animation duration accordingly.

@phantomdesvin
Copy link

phantomdesvin commented Jul 28, 2024

As an animator I'm personally used to how it works in most animation programs I've work with, where you just select some keyframes, hold ALT and LeftClick on the first or the last keyframe and drag. The point of reference is the other extreme of the selection (if you clicked on the last keyframe of the selection, the reference would be the first keyframe of the selection, so that first keyframe would mantain it's position in the timeline).

In practice, animators never scale from any point other than the start or the end of the selection because it would be a bad practice to risk interfering with previous and next keyframes at the same time and I can't see a reason to do that, so I wouldn't sacrifice the simplicity of this common workflow to accomodate that option, that can be achieved just scaling from one extreme first and then dragging the selection to the side. But if there is actually some reason to scale from center (please let me know), ALT+Shift + LClick could be a way to scale from center.

Moving/scaling keyframes beyond the max duration of the animation is common practice in animation programs, but automatically extending the animation duration accordingly is not, and I can see that being undesirable in some cases and, if that other proposal about time is implemented, it should already be quick and easy to modify when actually needed.

@Kartopod
Copy link

Using S in blender feels very intuitive and I would love to see it come to godot. If S is being implemented, I would love to also see G and R being implemented in the normal timeline AND the bezier curve editor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants