Merge pull request #93980 from TokageItLab/fix-sync-track-editor-position-with-player-editor

Fix broken sync between animation TrackEditor and PlayerEditor
This commit is contained in:
Rémi Verschelde
2024-07-07 12:38:37 +02:00
3 changed files with 9 additions and 17 deletions

View File

@@ -1395,23 +1395,14 @@ void AnimationPlayerEditor::_current_animation_changed(const String &p_name) {
void AnimationPlayerEditor::_animation_key_editor_anim_len_changed(float p_len) {
frame->set_max(p_len);
}
void AnimationPlayerEditor::_animation_key_editor_seek(float p_pos, bool p_timeline_only) {
void AnimationPlayerEditor::_animation_key_editor_seek(float p_pos, bool p_timeline_only, bool p_update_position_only) {
timeline_position = p_pos;
if (!is_visible_in_tree()) {
return;
}
if (!player) {
return;
}
if (player->is_playing()) {
return;
}
if (!player->has_animation(player->get_assigned_animation())) {
if (!is_visible_in_tree() ||
p_update_position_only ||
!player ||
player->is_playing() ||
!player->has_animation(player->get_assigned_animation())) {
return;
}

View File

@@ -214,7 +214,7 @@ class AnimationPlayerEditor : public VBoxContainer {
void _animation_player_changed(Object *p_pl);
void _animation_libraries_updated();
void _animation_key_editor_seek(float p_pos, bool p_timeline_only = false);
void _animation_key_editor_seek(float p_pos, bool p_timeline_only = false, bool p_update_position_only = false);
void _animation_key_editor_anim_len_changed(float p_len);
virtual void shortcut_input(const Ref<InputEvent> &p_ev) override;