Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions editor/animation/animation_player_editor_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ void AnimationPlayerEditor::_autoplay_pressed() {
}
}

void AnimationPlayerEditor::_go_to_nearest_keyframe(bool p_backward) {
void AnimationPlayerEditor::go_to_nearest_keyframe(bool p_backward) {
if (_get_current().is_empty()) {
return;
}
Expand Down Expand Up @@ -1646,10 +1646,10 @@ void AnimationPlayerEditor::shortcut_input(const Ref<InputEvent> &p_ev) {
_play_bw_pressed();
accept_event();
} else if (ED_IS_SHORTCUT("animation_editor/go_to_next_keyframe", p_ev)) {
_go_to_nearest_keyframe(false);
go_to_nearest_keyframe(false);
accept_event();
} else if (ED_IS_SHORTCUT("animation_editor/go_to_previous_keyframe", p_ev)) {
_go_to_nearest_keyframe(true);
go_to_nearest_keyframe(true);
accept_event();
}
}
Expand Down Expand Up @@ -2277,8 +2277,6 @@ void fragment() {
ED_SHORTCUT("animation_editor/play_animation_backwards", TTRC("Play Animation Backwards"), Key::A);
ED_SHORTCUT("animation_editor/play_animation_from_start", TTRC("Play Animation from Start"), KeyModifierMask::SHIFT + Key::D);
ED_SHORTCUT("animation_editor/play_animation_from_end", TTRC("Play Animation Backwards from End"), KeyModifierMask::SHIFT + Key::A);
ED_SHORTCUT("animation_editor/go_to_next_keyframe", TTRC("Go to Next Keyframe"), KeyModifierMask::SHIFT + KeyModifierMask::ALT + Key::D);
ED_SHORTCUT("animation_editor/go_to_previous_keyframe", TTRC("Go to Previous Keyframe"), KeyModifierMask::SHIFT + KeyModifierMask::ALT + Key::A);
}

AnimationPlayerEditor::~AnimationPlayerEditor() {
Expand Down
2 changes: 1 addition & 1 deletion editor/animation/animation_player_editor_plugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,6 @@ class AnimationPlayerEditor : public VBoxContainer {

void _select_anim_by_name(const String &p_anim);
float _get_editor_step() const;
void _go_to_nearest_keyframe(bool p_backward);
void _play_pressed();
void _play_from_pressed();
void _play_bw_pressed();
Expand Down Expand Up @@ -270,6 +269,7 @@ class AnimationPlayerEditor : public VBoxContainer {
void clear();

void ensure_visibility();
void go_to_nearest_keyframe(bool p_backward);

void edit(AnimationMixer *p_node, AnimationPlayer *p_player, bool p_is_dummy);
void forward_force_draw_over_viewport(Control *p_overlay);
Expand Down
10 changes: 10 additions & 0 deletions editor/animation/animation_track_editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7260,6 +7260,13 @@ void AnimationTrackEditor::_edit_menu_pressed(int p_option) {
goto_prev_step(false);
} break;

case EDIT_GOTO_NEXT_KEYFRAME: {
AnimationPlayerEditor::get_singleton()->go_to_nearest_keyframe(false);
} break;
case EDIT_GOTO_PREV_KEYFRAME: {
AnimationPlayerEditor::get_singleton()->go_to_nearest_keyframe(true);
} break;

case EDIT_APPLY_RESET: {
AnimationPlayerEditor::get_singleton()->get_player()->apply_reset(true);
} break;
Expand Down Expand Up @@ -8029,6 +8036,9 @@ AnimationTrackEditor::AnimationTrackEditor() {
edit->get_popup()->add_shortcut(ED_SHORTCUT("animation_editor/goto_next_step", TTRC("Go to Next Step"), KeyModifierMask::CMD_OR_CTRL | Key::RIGHT), EDIT_GOTO_NEXT_STEP);
edit->get_popup()->add_shortcut(ED_SHORTCUT("animation_editor/goto_prev_step", TTRC("Go to Previous Step"), KeyModifierMask::CMD_OR_CTRL | Key::LEFT), EDIT_GOTO_PREV_STEP);
edit->get_popup()->add_separator();
edit->get_popup()->add_shortcut(ED_SHORTCUT("animation_editor/go_to_next_keyframe", TTRC("Go to Next Keyframe"), KeyModifierMask::SHIFT | KeyModifierMask::ALT | Key::D), EDIT_GOTO_NEXT_KEYFRAME);
edit->get_popup()->add_shortcut(ED_SHORTCUT("animation_editor/go_to_previous_keyframe", TTRC("Go to Previous Keyframe"), KeyModifierMask::SHIFT | KeyModifierMask::ALT | Key::A), EDIT_GOTO_PREV_KEYFRAME);
edit->get_popup()->add_separator();
edit->get_popup()->add_shortcut(ED_SHORTCUT("animation_editor/apply_reset", TTRC("Apply Reset")), EDIT_APPLY_RESET);
edit->get_popup()->add_separator();
edit->get_popup()->add_item(TTR("Bake Animation..."), EDIT_BAKE_ANIMATION);
Expand Down
4 changes: 3 additions & 1 deletion editor/animation/animation_track_editor.h
Original file line number Diff line number Diff line change
Expand Up @@ -917,7 +917,9 @@ class AnimationTrackEditor : public VBoxContainer {
EDIT_OPTIMIZE_ANIMATION,
EDIT_OPTIMIZE_ANIMATION_CONFIRM,
EDIT_CLEAN_UP_ANIMATION,
EDIT_CLEAN_UP_ANIMATION_CONFIRM
EDIT_CLEAN_UP_ANIMATION_CONFIRM,
EDIT_GOTO_NEXT_KEYFRAME,
EDIT_GOTO_PREV_KEYFRAME,
};

void add_track_edit_plugin(const Ref<AnimationTrackEditPlugin> &p_plugin);
Expand Down