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

Fix scene not updated when editing animation track key value in AnimationTrackKeyEdit Inspector panel #94913

Closed
wants to merge 1 commit into from

Conversation

ChrisBase
Copy link
Contributor

@ChrisBase ChrisBase commented Jul 29, 2024

Test environment

Godot Engine v4.3.rc1.official
Windows 11 Pro, Version 23H2, Build 22631.3880

Issue

Modifications to properties related to AnimationTrackKeyEdit instances do not request the animation player to update.

Fix

This fix modifies the AnimationTrackEditor::_animation_changed() method to call the AnimationPlayer::advance() method of the animation player with a zero offset. That forces the animation player to udate and the UI to refresh.

@AThousandShips AThousandShips changed the title Fixed issue #78131. Fix scene not updated when editing animation track key value in AnimationTrackKeyEdit Inspector panel Jul 29, 2024
@AThousandShips AThousandShips requested a review from a team July 29, 2024 13:02
@AThousandShips AThousandShips added bug topic:editor topic:animation cherrypick:4.2 Considered for cherry-picking into a future 4.2.x release cherrypick:4.3 Considered for cherry-picking into a future 4.3.x release labels Jul 29, 2024
@AThousandShips AThousandShips added this to the 4.4 milestone Jul 29, 2024
editor/animation_track_editor.cpp Outdated Show resolved Hide resolved
editor/animation_track_editor.cpp Outdated Show resolved Hide resolved
@ChrisBase ChrisBase force-pushed the issue_78131 branch 2 times, most recently from ea7ab81 to 4c513a8 Compare July 29, 2024 13:05
@AThousandShips
Copy link
Member

Also please update your commit title (with git commit --amend) to be descriptive of what the PR does, the title of this PR would be appropriate (in the future, please don't reference issues in the title of a commit, see here

@ChrisBase ChrisBase force-pushed the issue_78131 branch 2 times, most recently from 7c7af2e to 314c721 Compare July 29, 2024 17:31
@ChrisBase
Copy link
Contributor Author

ChrisBase commented Jul 29, 2024

The previous fix updated AnimationTrackKeyEdit::_update_obj() instead of AnimationTrackEditor::_animation_changed() to call the AnimationPlayer::advance(), but that would not work for animation changes by undo/redo actions.
Now AnimationPlayer::advance() is called in AnimationTrackEditor::_animation_changed() which works for all cases.
The pull request description is updated accordingly.

@TokageItLab
Copy link
Member

TokageItLab commented Jul 30, 2024

Since a more correct implementation is already in the pre-merge stage as #91599, I suggest closing this PR and giving priority to that one. If you find something missing in that PR, please comment there.

@TokageItLab TokageItLab removed cherrypick:4.2 Considered for cherry-picking into a future 4.2.x release cherrypick:4.3 Considered for cherry-picking into a future 4.3.x release labels Jul 30, 2024
@TokageItLab TokageItLab removed this from the 4.4 milestone Jul 30, 2024
@AThousandShips AThousandShips added this to the 4.x milestone Jul 30, 2024
@ChrisBase
Copy link
Contributor Author

Since a more correct implementation is already in the pre-merge stage as #91599, I suggest closing this PR and giving priority to that one. If you find something missing in that PR, please comment there.

I tested #91599 and i can confirm that it fixes #78131.

@ChrisBase ChrisBase closed this Jul 30, 2024
@AThousandShips AThousandShips removed this from the 4.x milestone Jul 30, 2024
@ChrisBase ChrisBase deleted the issue_78131 branch July 30, 2024 10:04
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.

Scene not updated when editing animation track key value in AnimationTrackKeyEdit Inspector panel
3 participants