From 11805ac01d88cb0256df305d0072706e07ab8a6a Mon Sep 17 00:00:00 2001 From: reduz Date: Thu, 23 Jun 2022 08:35:34 +0200 Subject: [PATCH] Respect disabled animation tracks Fixes #25537, supersedes #60509 --- scene/animation/animation_player.cpp | 3 +++ scene/animation/animation_tree.cpp | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/scene/animation/animation_player.cpp b/scene/animation/animation_player.cpp index 5d471c9e847..967b4513a07 100644 --- a/scene/animation/animation_player.cpp +++ b/scene/animation/animation_player.cpp @@ -283,6 +283,9 @@ 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] = nullptr; Ref resource; Vector leftover_path; diff --git a/scene/animation/animation_tree.cpp b/scene/animation/animation_tree.cpp index 136285c4dc1..d95b00dd329 100644 --- a/scene/animation/animation_tree.cpp +++ b/scene/animation/animation_tree.cpp @@ -965,6 +965,10 @@ void AnimationTree::_process_graph(double p_delta) { #endif // _3D_DISABLED 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));