Fix AnimationMixer error spam by respecting cache validity on invalid root_node#113140
Merged
akien-mga merged 1 commit intogodotengine:masterfrom Nov 26, 2025
Conversation
aa1013e to
a15c8e4
Compare
TokageItLab
requested changes
Nov 25, 2025
Member
TokageItLab
left a comment
There was a problem hiding this comment.
Considering the function's meaning, I think it is incorrect for _blend_pre_process() to return cache_valid.
Therefore, if you want to do that, simply adding the following check should suffice:
animation_mixer.cpp
void AnimationMixer::_process_animation(double p_delta, bool p_update_only) {
_blend_init();
if (cache_valid && _blend_pre_process(p_delta, track_count, track_map)) {
_blend_capture(p_delta);
_blend_calc_total_weight();
_blend_process(p_delta, p_update_only);
_blend_apply();
_blend_post_process();
emit_signal(SNAME("mixer_applied"));
};
clear_animation_instances();
}a15c8e4 to
d968c3e
Compare
TokageItLab
approved these changes
Nov 25, 2025
Member
|
Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
When an AnimationMixer has an invalid root_node path assigned, attempting to play an animation causes the engine to spam the console with "No animation in cache" errors on every frame. This makes debugging extremely difficult and obscures real issues.
For example:
it gives

No animation in cacheerrors on every frame:Root Cause
The
_update_caches()method correctly detects an invalidroot_nodeand setscache_valid = false. However,_blend_pre_process()was returningtrue, which allowed_process_animation()to continue executing the entire blending pipeline (_blend_calc_total_weight(),_blend_process(), etc.). These downstream functions then fail due to missing caches and spam errors repeatedly.Proposed Solution
_blend_pre_process()fromtruetocache_valid. This ensures that if caches are not built (due to invalidroot_nodeor other reasons), the entire blending process is skipped immediately._update_caches()to be more descriptive and useWARN_PRINT_ONCE, providing developers with an immediate, actionable message instead of vague downstream errors.After these changes, it gives:
