summaryrefslogtreecommitdiffstats
path: root/editor/plugins/animation_blend_space_1d_editor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/plugins/animation_blend_space_1d_editor.cpp')
-rw-r--r--editor/plugins/animation_blend_space_1d_editor.cpp16
1 files changed, 5 insertions, 11 deletions
diff --git a/editor/plugins/animation_blend_space_1d_editor.cpp b/editor/plugins/animation_blend_space_1d_editor.cpp
index 89c21ddb68..184cc5302a 100644
--- a/editor/plugins/animation_blend_space_1d_editor.cpp
+++ b/editor/plugins/animation_blend_space_1d_editor.cpp
@@ -78,18 +78,12 @@ void AnimationNodeBlendSpace1DEditor::_blend_space_gui_input(const Ref<InputEven
menu->add_submenu_item(TTR("Add Animation"), "animations");
- if (tree->has_node(tree->get_animation_player())) {
- AnimationPlayer *ap = Object::cast_to<AnimationPlayer>(tree->get_node(tree->get_animation_player()));
+ List<StringName> names;
+ tree->get_animation_list(&names);
- if (ap) {
- List<StringName> names;
- ap->get_animation_list(&names);
-
- for (const StringName &E : names) {
- animations_menu->add_icon_item(get_editor_theme_icon(SNAME("Animation")), E);
- animations_to_add.push_back(E);
- }
- }
+ for (const StringName &E : names) {
+ animations_menu->add_icon_item(get_editor_theme_icon(SNAME("Animation")), E);
+ animations_to_add.push_back(E);
}
for (const StringName &E : classes) {