Merge pull request #62510 from MinusKube/animation-reset-crash

Fix animation player crashing when caching disabled tracks
This commit is contained in:
Rémi Verschelde 2022-06-29 10:19:33 +02:00 committed by GitHub
commit d631ee3307
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -283,10 +283,12 @@ void AnimationPlayer::_ensure_node_caches(AnimationData *p_anim, Node *p_root_ov
setup_pass++;
for (int i = 0; i < a->get_track_count(); i++) {
p_anim->node_cache.write[i] = nullptr;
if (!a->track_is_enabled(i)) {
continue;
}
p_anim->node_cache.write[i] = nullptr;
Ref<Resource> resource;
Vector<StringName> leftover_path;
Node *child = parent->get_node_and_resource(a->track_get_path(i), resource, leftover_path);