summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRémi Verschelde <remi@verschelde.fr>2022-08-29 07:50:00 +0200
committerGitHub <noreply@github.com>2022-08-29 07:50:00 +0200
commit17825573399e141fbc92b3ef3022c04205c16468 (patch)
treea9ae30a5a73af59c57b5c7f65f111285b46fa87c
parent127f46253627d7e6fc72932627659a44982d5500 (diff)
parentd5a559abc23926cbdfd0822fc79de3fc93cf1589 (diff)
downloadredot-engine-17825573399e141fbc92b3ef3022c04205c16468.tar.gz
Merge pull request #64386 from timothyqiu/anim-disable
Fix crash when loading Animation Library after reloading a scene
-rw-r--r--editor/plugins/animation_player_editor_plugin.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/editor/plugins/animation_player_editor_plugin.cpp b/editor/plugins/animation_player_editor_plugin.cpp
index e47c5b1e4b..1ab60e8fc8 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<StringName> 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();