Remove incorrect errors in AnimationMixer

This commit is contained in:
Ryan
2025-03-20 20:00:07 -04:00
parent 4c311cbee6
commit 8df0234101

View File

@ -613,7 +613,11 @@ void AnimationMixer::_init_root_motion_cache() {
} }
void AnimationMixer::_create_track_num_to_track_cache_for_animation(Ref<Animation> &p_animation) { void AnimationMixer::_create_track_num_to_track_cache_for_animation(Ref<Animation> &p_animation) {
ERR_FAIL_COND(animation_track_num_to_track_cache.has(p_animation)); if (animation_track_num_to_track_cache.has(p_animation)) {
// In AnimationMixer::_update_caches, it retrieves all animations via AnimationMixer::get_animation_list
// Since multiple AnimationLibraries can share the same Animation, it is possible that the cache is already created.
return;
}
LocalVector<TrackCache *> &track_num_to_track_cache = animation_track_num_to_track_cache.insert_new(p_animation, LocalVector<TrackCache *>())->value; LocalVector<TrackCache *> &track_num_to_track_cache = animation_track_num_to_track_cache.insert_new(p_animation, LocalVector<TrackCache *>())->value;
const Vector<Animation::Track *> &tracks = p_animation->get_tracks(); const Vector<Animation::Track *> &tracks = p_animation->get_tracks();