diff options
author | PouleyKetchoupp <pouleyketchoup@gmail.com> | 2019-11-30 17:47:09 +0100 |
---|---|---|
committer | PouleyKetchoupp <pouleyketchoup@gmail.com> | 2019-12-01 15:45:23 +0100 |
commit | d900cfafa367e7fbc867739cf6cc69bde0abaadc (patch) | |
tree | 132715d02ae957d6cffa262446ccc60dd2de7a9a /editor/plugins | |
parent | 1b40a95b6f34d4024c732ef68b3ba96e4bd6e6f1 (diff) |
Fixed errors in AnimationPlayerEditor when switching current_animation in the inspector
Case 1: start and stop an animation in the inspector
Case 2: start an animation in the inspector, then stop and start again in the track editor
Fixes #34021
Diffstat (limited to 'editor/plugins')
-rw-r--r-- | editor/plugins/animation_player_editor_plugin.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/editor/plugins/animation_player_editor_plugin.cpp b/editor/plugins/animation_player_editor_plugin.cpp index 80353bab01..718156f12a 100644 --- a/editor/plugins/animation_player_editor_plugin.cpp +++ b/editor/plugins/animation_player_editor_plugin.cpp @@ -85,6 +85,9 @@ void AnimationPlayerEditor::_notification(int p_what) { track_editor->set_anim_pos(player->get_current_animation_position()); EditorNode::get_singleton()->get_inspector()->refresh(); + } else if (!player->is_valid()) { + // Reset timeline when the player has been stopped externally + frame->set_value(0); } else if (last_active) { // Need the last frame after it stopped. frame->set_value(player->get_current_animation_position()); |