summaryrefslogtreecommitdiffstats
path: root/editor/plugins/animation_tree_editor_plugin.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/plugins/animation_tree_editor_plugin.cpp')
-rw-r--r--editor/plugins/animation_tree_editor_plugin.cpp24
1 files changed, 9 insertions, 15 deletions
diff --git a/editor/plugins/animation_tree_editor_plugin.cpp b/editor/plugins/animation_tree_editor_plugin.cpp
index 7b5f8aa7f7..1c642f909a 100644
--- a/editor/plugins/animation_tree_editor_plugin.cpp
+++ b/editor/plugins/animation_tree_editor_plugin.cpp
@@ -50,16 +50,16 @@
#include "scene/scene_string_names.h"
void AnimationTreeEditor::edit(AnimationTree *p_tree) {
- if (p_tree && !p_tree->is_connected("animation_player_changed", callable_mp(this, &AnimationTreeEditor::_animation_list_changed))) {
- p_tree->connect("animation_player_changed", callable_mp(this, &AnimationTreeEditor::_animation_list_changed), CONNECT_DEFERRED);
+ if (p_tree && !p_tree->is_connected("animation_list_changed", callable_mp(this, &AnimationTreeEditor::_animation_list_changed))) {
+ p_tree->connect("animation_list_changed", callable_mp(this, &AnimationTreeEditor::_animation_list_changed), CONNECT_DEFERRED);
}
if (tree == p_tree) {
return;
}
- if (tree && tree->is_connected("animation_player_changed", callable_mp(this, &AnimationTreeEditor::_animation_list_changed))) {
- tree->disconnect("animation_player_changed", callable_mp(this, &AnimationTreeEditor::_animation_list_changed));
+ if (tree && tree->is_connected("animation_list_changed", callable_mp(this, &AnimationTreeEditor::_animation_list_changed))) {
+ tree->disconnect("animation_list_changed", callable_mp(this, &AnimationTreeEditor::_animation_list_changed));
}
tree = p_tree;
@@ -122,7 +122,7 @@ void AnimationTreeEditor::_update_path() {
void AnimationTreeEditor::edit_path(const Vector<String> &p_path) {
button_path.clear();
- Ref<AnimationNode> node = tree->get_tree_root();
+ Ref<AnimationNode> node = tree->get_root_animation_node();
if (node.is_valid()) {
current_root = node->get_instance_id();
@@ -185,8 +185,8 @@ void AnimationTreeEditor::_notification(int p_what) {
} break;
case NOTIFICATION_PROCESS: {
ObjectID root;
- if (tree && tree->get_tree_root().is_valid()) {
- root = tree->get_tree_root()->get_instance_id();
+ if (tree && tree->get_root_animation_node().is_valid()) {
+ root = tree->get_root_animation_node()->get_instance_id();
}
if (root != current_root) {
@@ -247,18 +247,12 @@ Vector<String> AnimationTreeEditor::get_animation_list() {
}
AnimationTree *tree = singleton->tree;
- if (!tree || !tree->has_node(tree->get_animation_player())) {
- return Vector<String>();
- }
-
- AnimationPlayer *ap = Object::cast_to<AnimationPlayer>(tree->get_node(tree->get_animation_player()));
-
- if (!ap) {
+ if (!tree) {
return Vector<String>();
}
List<StringName> anims;
- ap->get_animation_list(&anims);
+ tree->get_animation_list(&anims);
Vector<String> ret;
for (const StringName &E : anims) {
ret.push_back(E);