From ab86ae7c2c48edaedc5178bfcdff206afd41552e Mon Sep 17 00:00:00 2001 From: Relintai Date: Thu, 11 Aug 2022 22:50:39 +0200 Subject: [PATCH] Backported form godot4: Respect disabled animation tracks - reduz https://github.com/godotengine/godot/commit/11805ac01d88cb0256df305d0072706e07ab8a6a --- scene/animation/animation_player.cpp | 4 ++++ scene/animation/animation_tree.cpp | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/scene/animation/animation_player.cpp b/scene/animation/animation_player.cpp index 817e44477..634e5ec13 100644 --- a/scene/animation/animation_player.cpp +++ b/scene/animation/animation_player.cpp @@ -255,6 +255,10 @@ void AnimationPlayer::_ensure_node_caches(AnimationData *p_anim, Node *p_root_ov setup_pass++; for (int i = 0; i < a->get_track_count(); i++) { + if (!a->track_is_enabled(i)) { + continue; + } + p_anim->node_cache.write[i] = NULL; RES resource; Vector leftover_path; diff --git a/scene/animation/animation_tree.cpp b/scene/animation/animation_tree.cpp index 816637f83..84f9134cc 100644 --- a/scene/animation/animation_tree.cpp +++ b/scene/animation/animation_tree.cpp @@ -878,6 +878,10 @@ void AnimationTree::_process_graph(float p_delta) { bool seeked = as.seeked; for (int i = 0; i < a->get_track_count(); i++) { + if (!a->track_is_enabled(i)) { + continue; + } + NodePath path = a->track_get_path(i); ERR_CONTINUE(!track_cache.has(path));