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

Update AnimationPlayer in real-time when keyframe properties change #91599

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

dnllowe
Copy link

@dnllowe dnllowe commented May 5, 2024

Implementation for proposal: godotengine/godot-proposals#9686

  • Reflect changes to keyframed properties in AnimationPlayer in realtime
  • Move AnimationPlayer position to key frame when key frame is selected

Reflect changes to keyframed properties in AnimationPlayer in realtime

Move AnimationPlayer position to key frame when key frame is selected
@Calinou
Copy link
Member

Calinou commented May 6, 2024

Move AnimationPlayer position to key frame when key frame is selected

Won't this cause issues when selecting multiple keyframes, particularly across different tracks?

Copy link
Member

@Calinou Calinou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested locally, it mostly works as expected.

Testing project: test_pr_91599.zip

I noticed 2 issues though:

  • Changing a key's easing in the inspector does not update what you see in the editor in real-time. It only updates when you scrub the timeline again:
simplescreenrecorder-2024-05-06_22.15.57.mp4
  • Using undo after modifying a key's value in the inspector does not reflect in real-time until you scrub the timeline:
simplescreenrecorder-2024-05-06_22.16.43.mp4

@dnllowe
Copy link
Author

dnllowe commented May 6, 2024

Tested locally, it mostly works as expected.

I noticed 2 issues though:

  • Changing a key's easing in the inspector does not update what you see in the editor in real-time. It only updates when you scrub the timeline again:

  • Using undo after modifying a key's value in the inspector does not reflect in real-time until you scrub the timeline:

Thanks for your review -- I'll iron these issues out

Copy link
Member

@TokageItLab TokageItLab left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From a code standpoint, it looks that the specified arguments of the AnimationPlayer methods are fine. I will wait for the fixes to some of the behaviors pointed out above.

Uses undo/redo action for seek behavior so it updates appropriately if user performs undo or redo
@dnllowe
Copy link
Author

dnllowe commented May 7, 2024

Good suggestions / catches. Both issues should be resolved now:

Changing easing, then performing undo/redo a couple of times

undo-redo-and-easing.mp4

editor/animation_track_editor.cpp Outdated Show resolved Hide resolved
dnllowe and others added 2 commits May 7, 2024 08:20
Co-authored-by: Silc Lizard (Tokage) Renew <tokage.it.lab@gmail.com>
Copy link
Member

@TokageItLab TokageItLab left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pointing out two things from the test:

fb.mp4
  • Selecting a keyframe causes a seek due to the KeyEdit updating on the inspector, which does not exist previously and probably was not the intended change and needs to be fixed
  • Inconsistencies occur when key times are moved by the inspector

@dnllowe
Copy link
Author

dnllowe commented May 11, 2024

I fixed it so that changing time will update the animation.

The issue in the video where editing the easing is the expected behavior, as the last frame's easing is being edited, which won't have an effect on the animation. The first keyframe would need to be selected and its easing changed for a change to occur.

I'm unsure what this really refers to:

Selecting a keyframe causes a seek due to the KeyEdit updating on the inspector, which does not exist previously and probably was not the intended change and needs to be fixed

I do intend to update the behavior so that selecting a keyframe seeks to it and updates the animation, but I'm not sure if that's the issue you're referring to.

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

Successfully merging this pull request may close these issues.

Update AnimationPlayer in real-time when keyframe properties change
4 participants