From d5a559abc23926cbdfd0822fc79de3fc93cf1589 Mon Sep 17 00:00:00 2001 From: Haoyu Qiu Date: Sun, 14 Aug 2022 18:50:42 +0800 Subject: Fix crash when loading Animation Library after reloading a scene --- editor/plugins/animation_player_editor_plugin.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'editor/plugins') diff --git a/editor/plugins/animation_player_editor_plugin.cpp b/editor/plugins/animation_player_editor_plugin.cpp index 516079673d..7b220f80a9 100644 --- a/editor/plugins/animation_player_editor_plugin.cpp +++ b/editor/plugins/animation_player_editor_plugin.cpp @@ -843,15 +843,16 @@ void AnimationPlayerEditor::_update_player() { animation->clear(); + tool_anim->set_disabled(player == nullptr); + pin->set_disabled(player == nullptr); + if (!player) { AnimationPlayerEditor::get_singleton()->get_track_editor()->update_keying(); return; } List libraries; - if (player) { - player->get_animation_library_list(&libraries); - } + player->get_animation_library_list(&libraries); int active_idx = -1; bool no_anims_found = true; @@ -926,10 +927,8 @@ void AnimationPlayerEditor::_update_player() { frame->set_editable(!no_anims_found); animation->set_disabled(no_anims_found); autoplay->set_disabled(no_anims_found); - tool_anim->set_disabled(player == nullptr); onion_toggle->set_disabled(no_anims_found); onion_skinning->set_disabled(no_anims_found); - pin->set_disabled(player == nullptr); _update_animation_list_icons(); -- cgit v1.2.3