1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-13 13:31:48 +00:00

Fix AnimationMixer breaking animations with redundant check

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 <rverschelde@gmail.com>
This commit is contained in:
Travis Lange
2024-02-19 09:29:36 -05:00
committed by Rémi Verschelde
parent 0246230e2b
commit ae97cf2ff0
2 changed files with 1 additions and 8 deletions

View File

@@ -661,13 +661,6 @@ bool AnimationMixer::_update_caches() {
Ref<Resource> resource; Ref<Resource> resource;
Vector<StringName> leftover_path; Vector<StringName> 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); Node *child = parent->get_node_and_resource(path, resource, leftover_path);
if (!child) { if (!child) {
if (check_path) { if (check_path) {

View File

@@ -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<Resource> &r_res, Vector<StringName> &r_leftover_subpath, bool p_last_is_property) const { Node *Node::get_node_and_resource(const NodePath &p_path, Ref<Resource> &r_res, Vector<StringName> &r_leftover_subpath, bool p_last_is_property) const {
ERR_THREAD_GUARD_V(nullptr); ERR_THREAD_GUARD_V(nullptr);
Node *node = get_node(p_path);
r_res = Ref<Resource>(); r_res = Ref<Resource>();
r_leftover_subpath = Vector<StringName>(); r_leftover_subpath = Vector<StringName>();
Node *node = get_node_or_null(p_path);
if (!node) { if (!node) {
return nullptr; return nullptr;
} }