summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémi Verschelde <remi@verschelde.fr>2022-06-23 09:13:54 +0200
committerGitHub <noreply@github.com>2022-06-23 09:13:54 +0200
commit64918e4ae99eb4e7a005e30901705a0c5b1a3161 (patch)
treeb2a3255ec3d67bfdcb38cc69ef966baeb1d532e0
parentdd6b427825f67bb28173e841be9e2e1f69e99c25 (diff)
parent11805ac01d88cb0256df305d0072706e07ab8a6a (diff)
Merge pull request #62337 from reduz/respect-disabled-animation-tracks
Respect disabled animation tracks
-rw-r--r--scene/animation/animation_player.cpp3
-rw-r--r--scene/animation/animation_tree.cpp4
2 files changed, 7 insertions, 0 deletions
diff --git a/scene/animation/animation_player.cpp b/scene/animation/animation_player.cpp
index e3c83e3a9e..2afe9ac35f 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> resource;
Vector<StringName> leftover_path;
diff --git a/scene/animation/animation_tree.cpp b/scene/animation/animation_tree.cpp
index 136285c4dc..d95b00dd32 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));