summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2019-12-01 16:24:11 +0100
committerGitHub <noreply@github.com>2019-12-01 16:24:11 +0100
commitd42ff4c2ae86dff7ca67ad846063090dcb7599eb (patch)
tree9a889cd456739241a1a13df18792454d11e37eef
parentd4415363795d74738eb51edd395368aeffcce6c1 (diff)
parentd900cfafa367e7fbc867739cf6cc69bde0abaadc (diff)
Merge pull request #34022 from nekomatata/animation-player-stop-errors
Fixed errors in AnimationPlayerEditor when switching current_animation in the inspector
-rw-r--r--editor/plugins/animation_player_editor_plugin.cpp3
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());