From e93a56ef3e517edfa6146ed62af4b9f85de96500 Mon Sep 17 00:00:00 2001 From: Michael Alexsander Silva Dias Date: Wed, 25 Apr 2018 22:09:41 -0300 Subject: [PATCH 1/2] Fixed deleting an animation marked to autoplay in the editor affecting the creation of one with the same name. --- editor/plugins/animation_player_editor_plugin.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/editor/plugins/animation_player_editor_plugin.cpp b/editor/plugins/animation_player_editor_plugin.cpp index 220003eb73..ae3a609f6a 100644 --- a/editor/plugins/animation_player_editor_plugin.cpp +++ b/editor/plugins/animation_player_editor_plugin.cpp @@ -459,6 +459,12 @@ void AnimationPlayerEditor::_animation_remove_confirmed() { Ref anim = player->get_animation(current); undo_redo->create_action(TTR("Remove Animation")); + if (player->get_autoplay() == current) { + undo_redo->add_do_method(player, "set_autoplay", ""); + undo_redo->add_undo_method(player, "set_autoplay", current); + // Avoid having the autoplay icon linger around if there is only one animation in the player + undo_redo->add_do_method(this, "_animation_player_changed", player); + } undo_redo->add_do_method(player, "remove_animation", current); undo_redo->add_undo_method(player, "add_animation", current, anim); undo_redo->add_do_method(this, "_animation_player_changed", player); From 75897710b301b7c5254ecd67099f31cb6ee840d5 Mon Sep 17 00:00:00 2001 From: Michael Alexsander Silva Dias Date: Fri, 27 Apr 2018 16:05:10 -0300 Subject: [PATCH 2/2] Made the Pin button disable when no AnimationPlayer is selected. --- editor/plugins/animation_player_editor_plugin.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/editor/plugins/animation_player_editor_plugin.cpp b/editor/plugins/animation_player_editor_plugin.cpp index ae3a609f6a..b387972558 100644 --- a/editor/plugins/animation_player_editor_plugin.cpp +++ b/editor/plugins/animation_player_editor_plugin.cpp @@ -828,6 +828,7 @@ void AnimationPlayerEditor::_update_player() { save_anim->set_disabled(animlist.size() == 0); tool_anim->set_disabled(player == NULL); onion_skinning->set_disabled(player == NULL); + pin->set_disabled(player == NULL); int active_idx = -1; for (List::Element *E = animlist.front(); E; E = E->next()) {