Merge pull request #83417 from Rubonnek/show-animation-mixer-warning-when-relevant

Show AnimationMixer warning for non-numeric types only when relevant
This commit is contained in:
Rémi Verschelde 2023-10-16 10:43:26 +02:00
commit aa0be93a89
No known key found for this signature in database
GPG Key ID: C3336907360768E1
1 changed files with 17 additions and 15 deletions

View File

@ -871,21 +871,23 @@ bool AnimationMixer::_update_caches() {
// TODO: Currently, misc type cannot be blended. In the future, // TODO: Currently, misc type cannot be blended. In the future,
// it should have a separate blend weight, just as bool is converted to 0 and 1. // it should have a separate blend weight, just as bool is converted to 0 and 1.
// Then, it should provide the correct precedence value. // Then, it should provide the correct precedence value.
switch (track_value->init_value.get_type()) { if (track_value->is_continuous) {
case Variant::NIL: switch (track_value->init_value.get_type()) {
case Variant::STRING_NAME: case Variant::NIL:
case Variant::NODE_PATH: case Variant::STRING_NAME:
case Variant::RID: case Variant::NODE_PATH:
case Variant::OBJECT: case Variant::RID:
case Variant::CALLABLE: case Variant::OBJECT:
case Variant::SIGNAL: case Variant::CALLABLE:
case Variant::DICTIONARY: case Variant::SIGNAL:
case Variant::ARRAY: { case Variant::DICTIONARY:
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."); case Variant::ARRAY: {
track_value->is_continuous = false; 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.");
break; track_value->is_continuous = false;
} break;
default: { }
default: {
}
} }
} }