浏览代码

Respect disabled animation tracks

Fixes #25537, supersedes #60509
reduz 3 年之前
父节点
当前提交
11805ac01d
共有 2 个文件被更改,包括 7 次插入0 次删除
  1. 3 0
      scene/animation/animation_player.cpp
  2. 4 0
      scene/animation/animation_tree.cpp

+ 3 - 0
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;

+ 4 - 0
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));