3535#include " editor/editor_string_names.h"
3636#include " editor/editor_undo_redo_manager.h"
3737#include " editor/gui/editor_spin_slider.h"
38+ #include " editor/plugins/animation_player_editor_plugin.h"
3839#include " editor/themes/editor_scale.h"
3940#include " scene/gui/view_panner.h"
4041#include " scene/resources/text_line.h"
@@ -869,6 +870,11 @@ void AnimationBezierTrackEdit::_change_selected_keys_handle_mode(Animation::Hand
869870 undo_redo->add_undo_method (animation.ptr (), " bezier_track_set_key_out_handle" , track_key_pair.first , track_key_pair.second , animation->bezier_track_get_key_out_handle (track_key_pair.first , track_key_pair.second ));
870871 undo_redo->add_do_method (editor, " _bezier_track_set_key_handle_mode" , animation.ptr (), track_key_pair.first , track_key_pair.second , p_mode, p_auto ? Animation::HANDLE_SET_MODE_AUTO : Animation::HANDLE_SET_MODE_RESET);
871872 }
873+ AnimationPlayerEditor *ape = AnimationPlayerEditor::get_singleton ();
874+ if (ape) {
875+ undo_redo->add_do_method (ape, " _animation_update_key_frame" );
876+ undo_redo->add_undo_method (ape, " _animation_update_key_frame" );
877+ }
872878 undo_redo->commit_action ();
873879}
874880
@@ -1560,6 +1566,11 @@ void AnimationBezierTrackEdit::gui_input(const Ref<InputEvent> &p_event) {
15601566 undo_redo->add_do_method (animation.ptr (), " bezier_track_set_key_out_handle" , moving_handle_track, moving_handle_key, moving_handle_right, ratio);
15611567 undo_redo->add_undo_method (animation.ptr (), " bezier_track_set_key_out_handle" , moving_handle_track, moving_handle_key, animation->bezier_track_get_key_out_handle (moving_handle_track, moving_handle_key), ratio);
15621568 }
1569+ AnimationPlayerEditor *ape = AnimationPlayerEditor::get_singleton ();
1570+ if (ape) {
1571+ undo_redo->add_do_method (ape, " _animation_update_key_frame" );
1572+ undo_redo->add_undo_method (ape, " _animation_update_key_frame" );
1573+ }
15631574 undo_redo->commit_action ();
15641575 moving_handle = 0 ;
15651576 queue_redraw ();
@@ -1673,6 +1684,11 @@ void AnimationBezierTrackEdit::_menu_selected(int p_index) {
16731684 undo_redo->add_do_method (animation.ptr (), " track_insert_key" , selected_track, time, new_point);
16741685 undo_redo->add_undo_method (this , " _clear_selection_for_anim" , animation);
16751686 undo_redo->add_undo_method (animation.ptr (), " track_remove_key_at_time" , selected_track, time);
1687+ AnimationPlayerEditor *ape = AnimationPlayerEditor::get_singleton ();
1688+ if (ape) {
1689+ undo_redo->add_do_method (ape, " _animation_update_key_frame" );
1690+ undo_redo->add_undo_method (ape, " _animation_update_key_frame" );
1691+ }
16761692 undo_redo->commit_action ();
16771693 queue_redraw ();
16781694 }
@@ -1773,6 +1789,11 @@ void AnimationBezierTrackEdit::duplicate_selected_keys(real_t p_ofs, bool p_ofs_
17731789 i++;
17741790 }
17751791
1792+ AnimationPlayerEditor *ape = AnimationPlayerEditor::get_singleton ();
1793+ if (ape) {
1794+ undo_redo->add_do_method (ape, " _animation_update_key_frame" );
1795+ undo_redo->add_undo_method (ape, " _animation_update_key_frame" );
1796+ }
17761797 undo_redo->add_do_method (this , " queue_redraw" );
17771798 undo_redo->add_undo_method (this , " queue_redraw" );
17781799 undo_redo->commit_action ();
@@ -1822,6 +1843,15 @@ void AnimationBezierTrackEdit::copy_selected_keys(bool p_cut) {
18221843 undo_redo->add_undo_method (this , " _select_at_anim" , animation, E->key ().track , E->value ().pos , i == 0 );
18231844 i++;
18241845 }
1846+
1847+ AnimationPlayerEditor *ape = AnimationPlayerEditor::get_singleton ();
1848+ if (ape) {
1849+ undo_redo->add_do_method (ape, " _animation_update_key_frame" );
1850+ undo_redo->add_undo_method (ape, " _animation_update_key_frame" );
1851+ }
1852+ undo_redo->add_do_method (this , " queue_redraw" );
1853+ undo_redo->add_undo_method (this , " queue_redraw" );
1854+
18251855 undo_redo->commit_action ();
18261856 }
18271857}
@@ -1900,9 +1930,15 @@ void AnimationBezierTrackEdit::paste_keys(real_t p_ofs, bool p_ofs_valid) {
19001930 i++;
19011931 }
19021932
1903- undo_redo->commit_action ();
1933+ AnimationPlayerEditor *ape = AnimationPlayerEditor::get_singleton ();
1934+ if (ape) {
1935+ undo_redo->add_do_method (ape, " _animation_update_key_frame" );
1936+ undo_redo->add_undo_method (ape, " _animation_update_key_frame" );
1937+ }
1938+ undo_redo->add_do_method (this , " queue_redraw" );
1939+ undo_redo->add_undo_method (this , " queue_redraw" );
19041940
1905- queue_redraw ();
1941+ undo_redo-> commit_action ();
19061942 }
19071943}
19081944
@@ -1917,6 +1953,11 @@ void AnimationBezierTrackEdit::delete_selection() {
19171953 }
19181954 undo_redo->add_do_method (this , " _clear_selection_for_anim" , animation);
19191955 undo_redo->add_undo_method (this , " _clear_selection_for_anim" , animation);
1956+ AnimationPlayerEditor *ape = AnimationPlayerEditor::get_singleton ();
1957+ if (ape) {
1958+ undo_redo->add_do_method (ape, " _animation_update_key_frame" );
1959+ undo_redo->add_undo_method (ape, " _animation_update_key_frame" );
1960+ }
19201961 undo_redo->commit_action ();
19211962
19221963 // selection.clear();
@@ -1926,6 +1967,15 @@ void AnimationBezierTrackEdit::delete_selection() {
19261967void AnimationBezierTrackEdit::_bezier_track_insert_key_at_anim (const Ref<Animation> &p_anim, int p_track, double p_time, real_t p_value, const Vector2 &p_in_handle, const Vector2 &p_out_handle, const Animation::HandleMode p_handle_mode) {
19271968 int idx = p_anim->bezier_track_insert_key (p_track, p_time, p_value, p_in_handle, p_out_handle);
19281969 p_anim->bezier_track_set_key_handle_mode (p_track, idx, p_handle_mode);
1970+
1971+ EditorUndoRedoManager *undo_redo = EditorUndoRedoManager::get_singleton ();
1972+ undo_redo->create_action (TTR (" Animation Bezier Curve Change Call" ));
1973+ AnimationPlayerEditor *ape = AnimationPlayerEditor::get_singleton ();
1974+ if (ape) {
1975+ undo_redo->add_do_method (ape, " _animation_update_key_frame" );
1976+ undo_redo->add_undo_method (ape, " _animation_update_key_frame" );
1977+ }
1978+ undo_redo->commit_action ();
19291979}
19301980
19311981void AnimationBezierTrackEdit::_bind_methods () {
0 commit comments