summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkobewi <kobewi4e@gmail.com>2024-02-12 14:58:12 +0100
committerkobewi <kobewi4e@gmail.com>2024-02-12 16:24:23 +0100
commit154b4a51f2c454a4f74d3d57887d4bee59ea809c (patch)
treeef1f503c2a3d14d4881a917427bb5b259bd7d1da
parentf317cc713aa4dbcee2efa10db764473a56680be7 (diff)
downloadredot-engine-154b4a51f2c454a4f74d3d57887d4bee59ea809c.tar.gz
Improve AnimationMixer warnings
-rw-r--r--scene/animation/animation_mixer.cpp21
1 files changed, 17 insertions, 4 deletions
diff --git a/scene/animation/animation_mixer.cpp b/scene/animation/animation_mixer.cpp
index 78abdbdd3e..9f954fd6c0 100644
--- a/scene/animation/animation_mixer.cpp
+++ b/scene/animation/animation_mixer.cpp
@@ -603,6 +603,19 @@ bool AnimationMixer::_update_caches() {
return false;
}
+#ifdef TOOLS_ENABLED
+ String mixer_name = "AnimationMixer";
+ const Node *owner = get_owner();
+ if (owner) {
+ const String scene_path = owner->get_scene_file_path();
+ if (!scene_path.is_empty()) {
+ mixer_name += vformat(" (at: %s)", scene_path.get_file());
+ }
+ }
+#else
+ const String mixer_name = "AnimationMixer";
+#endif
+
Ref<Animation> reset_anim;
bool has_reset_anim = has_animation(SceneStringNames::get_singleton()->RESET);
if (has_reset_anim) {
@@ -858,20 +871,20 @@ bool AnimationMixer::_update_caches() {
bool skip_update_mode_warning = false;
if (track_value->is_continuous) {
if (!Animation::is_variant_interpolatable(track_value->init_value)) {
- WARN_PRINT_ONCE_ED("AnimationMixer: '" + String(E) + "', Value Track: '" + String(path) + "' uses a non-numeric type as key value with UpdateMode.UPDATE_CONTINUOUS. This will not be blended correctly, so it is forced to UpdateMode.UPDATE_DISCRETE.");
+ WARN_PRINT_ONCE_ED(mixer_name + ": '" + String(E) + "', Value Track: '" + String(path) + "' uses a non-numeric type as key value with UpdateMode.UPDATE_CONTINUOUS. This will not be blended correctly, so it is forced to UpdateMode.UPDATE_DISCRETE.");
track_value->is_continuous = false;
skip_update_mode_warning = true;
}
if (track_value->init_value.is_string()) {
- WARN_PRINT_ONCE_ED("AnimationMixer: '" + String(E) + "', Value Track: '" + String(path) + "' blends String types. This is an experimental algorithm.");
+ WARN_PRINT_ONCE_ED(mixer_name + ": '" + String(E) + "', Value Track: '" + String(path) + "' blends String types. This is an experimental algorithm.");
}
}
if (!skip_update_mode_warning && was_continuous != track_value->is_continuous) {
- WARN_PRINT_ONCE_ED("AnimationMixer: '" + String(E) + "', Value Track: '" + String(path) + "' has different update modes between some animations which may be blended together. Blending prioritizes UpdateMode.UPDATE_CONTINUOUS, so the process treats UpdateMode.UPDATE_DISCRETE as UpdateMode.UPDATE_CONTINUOUS with InterpolationType.INTERPOLATION_NEAREST.");
+ WARN_PRINT_ONCE_ED(mixer_name + ": '" + String(E) + "', Value Track: '" + String(path) + "' has different update modes between some animations which may be blended together. Blending prioritizes UpdateMode.UPDATE_CONTINUOUS, so the process treats UpdateMode.UPDATE_DISCRETE as UpdateMode.UPDATE_CONTINUOUS with InterpolationType.INTERPOLATION_NEAREST.");
}
if (was_using_angle != track_value->is_using_angle) {
- WARN_PRINT_ONCE_ED("AnimationMixer: '" + String(E) + "', Value Track: '" + String(path) + "' has different interpolation types for rotation between some animations which may be blended together. Blending prioritizes angle interpolation, so the blending result uses the shortest path referenced to the initial (RESET animation) value.");
+ WARN_PRINT_ONCE_ED(mixer_name + ": '" + String(E) + "', Value Track: '" + String(path) + "' has different interpolation types for rotation between some animations which may be blended together. Blending prioritizes angle interpolation, so the blending result uses the shortest path referenced to the initial (RESET animation) value.");
}
}