From ae97cf2ff01a385d6eeb2ff866ad5d6f8e8fae16 Mon Sep 17 00:00:00 2001 From: Travis Lange Date: Mon, 19 Feb 2024 09:29:36 -0500 Subject: [PATCH] Fix AnimationMixer breaking animations with redundant check MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Also change `Node::get_node_and_resource` to prevent it from printing an error from `Node::get_node`, and just returns nullptr. This is what the redundant check was trying to prevent. Fixes #88428. Co-authored-by: RĂ©mi Verschelde --- scene/animation/animation_mixer.cpp | 7 ------- scene/main/node.cpp | 2 +- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/scene/animation/animation_mixer.cpp b/scene/animation/animation_mixer.cpp index 706d2100649..87ac0bf5c8a 100644 --- a/scene/animation/animation_mixer.cpp +++ b/scene/animation/animation_mixer.cpp @@ -661,13 +661,6 @@ bool AnimationMixer::_update_caches() { Ref resource; Vector leftover_path; - if (!parent->has_node_and_resource(path)) { - if (check_path) { - WARN_PRINT_ED(mixer_name + ": '" + String(E) + "', couldn't resolve track: '" + String(path) + "'. This warning can be disabled in Project Settings."); - } - continue; - } - Node *child = parent->get_node_and_resource(path, resource, leftover_path); if (!child) { if (check_path) { diff --git a/scene/main/node.cpp b/scene/main/node.cpp index e814e4f0cd2..f827f68def0 100644 --- a/scene/main/node.cpp +++ b/scene/main/node.cpp @@ -3025,9 +3025,9 @@ Array Node::_get_node_and_resource(const NodePath &p_path) { Node *Node::get_node_and_resource(const NodePath &p_path, Ref &r_res, Vector &r_leftover_subpath, bool p_last_is_property) const { ERR_THREAD_GUARD_V(nullptr); - Node *node = get_node(p_path); r_res = Ref(); r_leftover_subpath = Vector(); + Node *node = get_node_or_null(p_path); if (!node) { return nullptr; }