Backported form godot4: Respect disabled animation tracks - reduz

11805ac01d
This commit is contained in:
Relintai 2022-08-11 22:50:39 +02:00
parent dc3500ec17
commit ab86ae7c2c
2 changed files with 8 additions and 0 deletions

View File

@ -255,6 +255,10 @@ void AnimationPlayer::_ensure_node_caches(AnimationData *p_anim, Node *p_root_ov
setup_pass++; setup_pass++;
for (int i = 0; i < a->get_track_count(); i++) { for (int i = 0; i < a->get_track_count(); i++) {
if (!a->track_is_enabled(i)) {
continue;
}
p_anim->node_cache.write[i] = NULL; p_anim->node_cache.write[i] = NULL;
RES resource; RES resource;
Vector<StringName> leftover_path; Vector<StringName> leftover_path;

View File

@ -878,6 +878,10 @@ void AnimationTree::_process_graph(float p_delta) {
bool seeked = as.seeked; bool seeked = as.seeked;
for (int i = 0; i < a->get_track_count(); i++) { for (int i = 0; i < a->get_track_count(); i++) {
if (!a->track_is_enabled(i)) {
continue;
}
NodePath path = a->track_get_path(i); NodePath path = a->track_get_path(i);
ERR_CONTINUE(!track_cache.has(path)); ERR_CONTINUE(!track_cache.has(path));