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

Improve the animation Bezier editor #3141

Closed
reduz opened this issue Aug 14, 2021 · 19 comments
Closed

Improve the animation Bezier editor #3141

reduz opened this issue Aug 14, 2021 · 19 comments

Comments

@reduz
Copy link
Member

reduz commented Aug 14, 2021

Describe the project you are working on

Godot

Describe the problem or limitation you are having in your project

Common user complains about editing animation beziers. More specifically:

  • Only one track at the same time can be edited.
  • Only visibility to the current node is allowed.

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

The idea is to overcome both those issues.

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

The plan is as follows:

  • By default, any point of any visible Bezier curve track will be editable/selectable/etc. instead of the selected track.
  • Selecting a single point on any visible curve, or just clicking the curve itself will cause the track on the track list to be selected.
  • Selecting single points always has priority for the selected track, this helps avoid issues when many points of several tracks overlap.
  • Locking tracks is possible on the list to the left thanks to new lock buttons. Only those locked will be selectable (if any is locked)
  • A Scope menu will be present, allowing visibility of all tracks in the animation or just on the current node. Changing this is dependent on the current selected track at the time the mode is changed.
  • Handle menu also converted to buttons, this is easier to use as it requires a single click to switch.
  • Closing the editor has always been confusing, so a proper close button is also added.

Mock up (editor is kind of broken on Master, but you get the idea):

image

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

no script can do this.

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

animation editor is core.

@Calinou Calinou changed the title Improve the Animation Bezier Editor Improve the animation Bezier editor Aug 14, 2021
@georgesboris
Copy link

Locking tracks is possible on the list to the left thanks to new lock buttons. Only those locked will be selectable (if any is locked)

I wonder if this should be the opposite? As in locked tracks cannot be selected by accident. This is usually how things work on design tools but I'm unsure if it's different on animation tools.

@mieldepoche
Copy link

mieldepoche commented Aug 14, 2021

I too would advocate for "locking curves" to mean locking them out of edits (just like nodes in scenes).
The "locking" functionality described here is more of a "selectable/editable" state than a locked one so I believe this would have to be either renamed or see its behavior flipped.
Blender also uses a locked state for editing curves but it's the opposite: locked curves cannot be edited.

@SilencedPerson
Copy link

Locking tracks is possible on the list to the left thanks to new lock buttons. Only those locked will be selectable (if any is locked)

I wonder if this should be the opposite? As in locked tracks cannot be selected by accident. This is usually how things work on design tools but I'm unsure if it's different on animation tools.

I too would advocate for "locking curves" to mean locking them out of edits (just like nodes in scenes).
The "locking" functionality described here is more of a "selectable/editable" state than a locked one so I believe this would have to be either renamed or see its behavior flipped.
Blender also uses a locked state for editing curves but it's the opposite: locked curves cannot be edited.

as an animator, my initial reaction was pretty much the same, however, i would like to give this approach a try, it seems to me like it could save quite a lot of clicks.

@reduz
Copy link
Member Author

reduz commented Aug 14, 2021

Indeed, I don't see the use case of leaving out a single track. On the contrary when you have lots of tracks, focusing in just a few but keeping the rest as reference is a lot more useful.

@Error7Studios
Copy link

Or maybe have 2 buttons, like a DAW.

Mute Solo

When you have 8 tracks, it's faster to Solo a track than to Mute the other 7.

@SilencedPerson
Copy link

Indeed, I don't see the use case of leaving out a single track. On the contrary when you have lots of tracks, focusing in just a few but keeping the rest as reference is a lot more useful.

the only thing i would change, is the name from lock to focus to avoid confusion.

@reduz
Copy link
Member Author

reduz commented Aug 14, 2021

@SilencedPerson well its an icon so it does not show a text.. maybe a different icon?

@reduz
Copy link
Member Author

reduz commented Aug 14, 2021

@Error7Studios In a DAW it makes complete sense to solo and mute tracks, here excluding a track does not make sense.

@SilencedPerson
Copy link

SilencedPerson commented Aug 14, 2021

@SilencedPerson well its an icon so it does not show a text.. maybe a different icon?
then i suggest the visibility eye from the scene tree. but only show the full eye and greyed out eye instead of the closed one. I feel like that says "focus"
image

@TokisanGames
Copy link

TokisanGames commented Aug 14, 2021

I'd like some sort of auto scale, auto fit / find key frames, and separate scales per track features. Usually value ranges have wildly different scales. I click on rotation, then pan and zoom to find values 0-360. Then click on a translation which could be values at 0-1 or 0-2000. When Animating one object, I'm constantly going back and forth between translation and rotation, so there is constant adjustment of the display so I can find the key frames.

Ideally I'd be able to get multiple curves on screen at once and be able to go back and forth to adjust them, meanwhile the scale is silently adjusting on the side. No manual adjustment of the display is needed, once I have it set up. No popping of the display as it automatically changes to view different scales. Instead just a stable display where only the numbers change and the curves stay there unless I change them, or change the window scaling or panning.

So I'd recommend:

  • per track scale or global scale modes
  • If i click a track, or select key frames it would be natural to press F to auto scale around the whole track or selected key frames (Y axis only).
  • if I select all tracks, or no tracks and press F, it scales around everything. This would do different things in pts or gs modes. In pts mode it would normalize the curves on individual scales. In gs mode, normalize everything on one scale.
  • in pts, clicking another track just updates the scale numbers, but doesn't move the curve unless I move the key frames or display.
  • A or ctrl+A could select all key frames.

Also we desperately need channel mute in the bezier editor. It's very annoying to have to go back to the regular editor to mute, then come back into bezier to adjust.

Solo mode is helpful, especially if you have an animation with 20-30 channels and need to figure out which one is causing the problem. Alternatively an enable /disable all tracks button would work fine. (main editor and bezier)

Other requests

  • Duplicate duplicates the key frame(s) at the cursor, overwriting whatever was there. Instead let the duplicated key frames hover with my mouse until I click or press enter to set them, or esc to cancel.

  • space bar should play / stop. Home and end should go to the start /end on the timeline.

@Arrow-x
Copy link

Arrow-x commented Aug 15, 2021

Adding a lattice deform tool will be very useful
GUID-9065EB8A-B6AB-426D-B1C4-79E591816BEB

@NathanLovato
Copy link

NathanLovato commented Aug 15, 2021

excluding a track does not make sense

It totally does, animators use that. I think it'd be good to get professional game animators in there, or people who worked on the animation editor UX in Blender in the discussion if possible. They'd certainly have lots of insights on the features animators need.

Hiding several tracks and isolating them (hiding unselected tracks) are both useful. It's quite common to work in isolation on a bunch of curves when doing animation cleanup: you might want to work on the transforms of just the legs' or a single arm on a character, etc.

That's similar to solo tracks in DAWs in a sense although it doesn't need to work with a solo button.

Then locking is useful too: you keep the tracks for reference of how the values change, of timing, but you don't want to select and modify them inadvertently. For example when animating a character's tail, to properly animate follow-through. on other segments of the tail.

To me, Blender is an excellent example when it comes to the animation editors: you can select multiple tracks from the left column and either toggle their visibility (leftmost icon), isolate them (shortcuts: H hides selected tracks, Shift H hides unselected as in the rest of Blender, alt H unhides everything), or lock them.

Below, the checkboxes are mute buttons, while you use visiblity to do the equivalent of solo in DAWs.

Screenshot from 2021-08-15 10-29-01

Back when I did animation (I studied 3d character animation for games specifically), I'd get to use all that on pretty much every animation.


So I second the idea of having some way to:

  • Lock one or more track, leaving them visible but preventing selection
  • Toggle one or more track's visibility
  • Isolate a bunch of tracks, and I'd say the way blender does it by allowing you to hide all unselected is really good
    • The above works especially well in Blender as you can select a track either by selecting one or more of its keys on the curves or by selecting in the margin on the left.

The rest of the proposed improvements and features is great, that's all much needed. Especially the ability to see and manipulate many anim tracks at once.

If you'd like, I'd be happy to get pro game animators in the loop for feedback in general on the animation tools in Godot. I'd be happy to help find them, collect their needs, and report on that (similar to the docs proposal from last year).

I'd also be happy to contribute some code and work on this editor's UX if you'd accept a new contributor there.

@LillyByte
Copy link

Bezier curves feel too far disconnected from everything else.

Might wanna look at this old proposal that's been sitting around forever too, where this issue was also discussed:

#392

@NathanLovato
Copy link

I asked @reduz if we could take care of this proposal at GDQuest and he said ok. So we'll get to work on this in the coming weeks!

@TokageItLab
Copy link
Member

TokageItLab commented Sep 18, 2021

This is an explanation of Auto-tangent and Extend handle in some animation applications, which I discussed with @NathanLovato on Contributors Chat before.

I hope to do is to make the Bezier manipulation tool select buttons instead of a pulldown, and put it in the container at the bottom that contains the zoom factor, etc

Also, I wish to add linear mode (which sets the length of tangent lines to zero).

Basically, the animation tool's Bezier editor defaults to linear mode, and from there you can do several operations to create Bezier curves, such as

  • Extend the handle to the right (and make free mode)
  • Extend the handle to the left (and make free mode)
  • Extend the handle to both the left and right (and make mirror or balanced mode)
  • Auto tangent (and make mirror or balanced mode); create tangent lines going to the previous and next keyframes

"mirror or balanced" means that different applications have different algorithms. After Effects uses balanced mode, which takes into account the distance between the previous and next keyframes, while Cinema4D uses mirror mode, which is based on one of the shorter keyframe distance of the previous and next keyframes. If you are interested, I will explain in detail.

The current Bezier editor has a problem that doesn't have the ability to easily reset to a preset tangent like above

handle_point

Both behave similarly. However, I personally feel that the one based on Balanced is smoother, because the handle length is equal between keyframes.


In addition, I think that the Linear, Mirror, Balance, and Free attributes should be assigned on keyframes instead of on the control mode. These attributes of keyframes can be used to control the input of values in the inspector. For example, a keyframe with Linear attribute can prohibit the manipulation of handle values. On the other hand, keyframe with Mirror or Balance attributes make it possible to manipulate the value of one handle to update the opposite handle at the same time.


Furthermore, it may need to implement the following shortcuts to constrain manipulation when we are grabbing the handle.

  • Constrain the angle of the tangent to 0
  • Change only the length without changing the tangent angle
  • In Free mode, align the angle of the opposite side of the handle you are grabbing and switch to Balanced mode

@NathanLovato
Copy link

Very clear, thanks. I'll likely make a separate proposal before adding all the above. Making handle mode a property of keyframes is already in progress: #3236

@Razoric480
Copy link

Razoric480 commented Nov 12, 2021

Still need #53298 to be merged since I made my branch off of that before I go and make a PR so I don't double any commits/conflicts, then can go through a review process with code cleanup suggestions, but I'm close to done otherwise.

Screenshot_1

Implementation list

  • All bezier curves drawn and selectable simultaneously
  • Can select a track by selecting one of its keys, or by clicking on the curve itself. Will prioritize the currently 'main selected' track since it's sorted first.
    • Selecting multiple tracks will set the first one in the list as main selected.
  • Fixed visual bugs. TextLine's introduction in 4.0 already takes string height into account so it was breaking rendering.
  • Moved the bezier track toggle from a track-button to being on the toolbar. This obsoletes the X Close button, so I removed it.
  • As it's based off of #53298 , handle modes are part of keys now, and without the handle mode menu, that left the right column empty, so I nixed it.
  • reduz mentioned a scope feature, but we already have the ability to filter by selected node as part of the track editor - so instead of re-implementing the feature, now the bezier editor responds to node filtering.
  • The ability to lock (visible but grayed out and unselectable), hide (invisible), solo (hides all except one) or delete tracks from the bezier editor (instead of having to close the editor, delete a track, re-open the editor...)
  • Some bug/omission fixes - in track editor, the trash can was kind of falling off half way down the right side, and moving the name limit space didn't move the bezier editor's, so now they're properly tied together.

Issue not sure how to proceed to fix

The default 150 pixels for the name limit is too small for the bezier editor and you end up with the icons overlapping the track names, but there's no way to change the name limit from outside, so the user has to extend it beforehand. Not sure if changing the default magic number of 150 would be appreciated, but it'd have the least knock-on effects or change of math.

Considerations

Animation software (like blender, maya, etc), when you have multiple keys selected and you move a bezier handle, all of the keys' handles move simultaneously by the relative amount. It wasn't implemented in 3.x, so I didn't put it here, but it could be a feature we'd think about.

@TokageItLab
Copy link
Member

Can we close this since godotengine/godot#64647 has been merged? Are there any features still missing?

@fire
Copy link
Member

fire commented Jun 13, 2023

Closing due the request for clarification being from last year.

I encourage future readers to make a new issue or proposal.

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