aboutsummaryrefslogtreecommitdiff
path: root/editor/plugins/animation_blend_space_2d_editor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/plugins/animation_blend_space_2d_editor.cpp')
-rw-r--r--editor/plugins/animation_blend_space_2d_editor.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/editor/plugins/animation_blend_space_2d_editor.cpp b/editor/plugins/animation_blend_space_2d_editor.cpp
index 775fdba93..8d1706224 100644
--- a/editor/plugins/animation_blend_space_2d_editor.cpp
+++ b/editor/plugins/animation_blend_space_2d_editor.cpp
@@ -54,7 +54,7 @@ void AnimationNodeBlendSpace2DEditor::_blend_space_gui_input(const Ref<InputEven
ClassDB::get_inheriters_from_class("AnimationRootNode", &classes);
menu->add_submenu_item(TTR("Add Animation"), "animations");
- AnimationGraphPlayer *gp = blend_space->get_graph_player();
+ AnimationTree *gp = blend_space->get_tree();
ERR_FAIL_COND(!gp);
if (gp && gp->has_node(gp->get_animation_player())) {
AnimationPlayer *ap = Object::cast_to<AnimationPlayer>(gp->get_node(gp->get_animation_player()));
@@ -693,12 +693,12 @@ void AnimationNodeBlendSpace2DEditor::_notification(int p_what) {
String error;
- if (!blend_space->get_graph_player()) {
- error = TTR("BlendSpace2D does not belong to an AnimationGraphPlayer node.");
- } else if (!blend_space->get_graph_player()->is_active()) {
- error = TTR("AnimationGraphPlayer is inactive.\nActivate to enable playback, check node warnings if activation fails.");
- } else if (blend_space->get_graph_player()->is_state_invalid()) {
- error = blend_space->get_graph_player()->get_invalid_state_reason();
+ if (!blend_space->get_tree()) {
+ error = TTR("BlendSpace2D does not belong to an AnimationTree node.");
+ } else if (!blend_space->get_tree()->is_active()) {
+ error = TTR("AnimationTree is inactive.\nActivate to enable playback, check node warnings if activation fails.");
+ } else if (blend_space->get_tree()->is_state_invalid()) {
+ error = blend_space->get_tree()->get_invalid_state_reason();
} else if (blend_space->get_triangle_count() == 0) {
error = TTR("No triangles exist, so no blending can take place.");
}