mirror of
https://github.com/godotengine/godot.git
synced 2025-02-01 14:45:22 +00:00
Automatically seek timeline in selected animation
This commit is contained in:
parent
871a9d5d56
commit
d482bd1ef0
@ -304,6 +304,7 @@ void AnimationPlayerEditor::_animation_selected(int p_which) {
|
|||||||
|
|
||||||
AnimationPlayerEditor::singleton->get_track_editor()->update_keying();
|
AnimationPlayerEditor::singleton->get_track_editor()->update_keying();
|
||||||
EditorNode::get_singleton()->update_keying();
|
EditorNode::get_singleton()->update_keying();
|
||||||
|
_animation_key_editor_seek(timeline_position, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AnimationPlayerEditor::_animation_new() {
|
void AnimationPlayerEditor::_animation_new() {
|
||||||
@ -1072,6 +1073,8 @@ void AnimationPlayerEditor::_animation_key_editor_anim_len_changed(float p_len)
|
|||||||
|
|
||||||
void AnimationPlayerEditor::_animation_key_editor_seek(float p_pos, bool p_drag) {
|
void AnimationPlayerEditor::_animation_key_editor_seek(float p_pos, bool p_drag) {
|
||||||
|
|
||||||
|
timeline_position = p_pos;
|
||||||
|
|
||||||
if (!is_visible_in_tree())
|
if (!is_visible_in_tree())
|
||||||
return;
|
return;
|
||||||
if (!player)
|
if (!player)
|
||||||
@ -1753,6 +1756,7 @@ AnimationPlayerEditor::AnimationPlayerEditor(EditorNode *p_editor, AnimationPlay
|
|||||||
|
|
||||||
renaming = false;
|
renaming = false;
|
||||||
last_active = false;
|
last_active = false;
|
||||||
|
timeline_position = 0;
|
||||||
|
|
||||||
set_process_unhandled_key_input(true);
|
set_process_unhandled_key_input(true);
|
||||||
|
|
||||||
|
@ -107,6 +107,7 @@ class AnimationPlayerEditor : public VBoxContainer {
|
|||||||
UndoRedo *undo_redo;
|
UndoRedo *undo_redo;
|
||||||
Ref<Texture> autoplay_icon;
|
Ref<Texture> autoplay_icon;
|
||||||
bool last_active;
|
bool last_active;
|
||||||
|
float timeline_position;
|
||||||
|
|
||||||
EditorFileDialog *file;
|
EditorFileDialog *file;
|
||||||
AcceptDialog *accept;
|
AcceptDialog *accept;
|
||||||
|
Loading…
Reference in New Issue
Block a user