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

Fixed AnimationTrackEditor redraw/deselect timing and some refactoring #64980

Merged

Conversation

TokageItLab
Copy link
Member

@TokageItLab TokageItLab commented Aug 28, 2022

Fixed some weird redraw timings and most of errors by key editing.

Desktop.2022.08.29.-.11.18.15.01.mp4

In some edit commands, deselection and redraw were missing, causing errors in Undo/Redo during key selection. Also, there were many duplicates of the code for redraw, so it is refactored by making it a function.


Additional fixes:

Follow up #64678, track key times are stored as double values, but if it store double value directly, the baked animation key finding was failing because Animation::track_find_key() comparisons are too strict. Fixed it by making baked keys in real_t time.1

Some little fixes such as following up #64951 (renamed internal variables to more appropriate).

Footnotes

  1. Also, it seems to be that the glTF animation times are baked as real_t in GLTFDocument::_serialize_animations(). If you want to store double values directly, we need to use Math::is_equal_approx() in Animation::track_find_key()

@TokageItLab TokageItLab added this to the 4.0 milestone Aug 28, 2022
@TokageItLab TokageItLab changed the title Fixed AnimationTrackEditor redraw timing and find key compearation Fixed AnimationTrackEditor redraw timing and find key compearation Aug 28, 2022
@TokageItLab TokageItLab force-pushed the fix-animedit-draw-and-find-key branch 5 times, most recently from ab01b21 to 84486b0 Compare August 28, 2022 18:31
@TokageItLab TokageItLab marked this pull request as draft August 28, 2022 18:45
@TokageItLab TokageItLab force-pushed the fix-animedit-draw-and-find-key branch from 84486b0 to 0dfe85f Compare August 28, 2022 19:50
@TokageItLab TokageItLab marked this pull request as ready for review August 28, 2022 19:50
@TokageItLab TokageItLab force-pushed the fix-animedit-draw-and-find-key branch 2 times, most recently from 4ea412c to 6c66d39 Compare August 28, 2022 20:01
@TokageItLab TokageItLab changed the title Fixed AnimationTrackEditor redraw timing and find key compearation Fixed AnimationTrackEditor redraw/deselect timing and find key compearation Aug 28, 2022
@TokageItLab TokageItLab force-pushed the fix-animedit-draw-and-find-key branch from 6c66d39 to 77cf519 Compare August 29, 2022 01:44
@TokageItLab TokageItLab changed the title Fixed AnimationTrackEditor redraw/deselect timing and find key compearation Fixed AnimationTrackEditor redraw/deselect timing and some refactoring Aug 29, 2022
@akien-mga akien-mga merged commit 583c0c4 into godotengine:master Aug 29, 2022
@akien-mga
Copy link
Member

Thanks!

@TokageItLab TokageItLab deleted the fix-animedit-draw-and-find-key branch September 16, 2022 21:01
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.

2 participants