diff options
Diffstat (limited to 'scene/animation')
| -rw-r--r-- | scene/animation/animation_mixer.cpp | 21 | ||||
| -rw-r--r-- | scene/animation/animation_player.cpp | 4 | ||||
| -rw-r--r-- | scene/animation/tween.cpp | 4 |
3 files changed, 25 insertions, 4 deletions
diff --git a/scene/animation/animation_mixer.cpp b/scene/animation/animation_mixer.cpp index d99f5aa3e4..cca1c6efbb 100644 --- a/scene/animation/animation_mixer.cpp +++ b/scene/animation/animation_mixer.cpp @@ -868,6 +868,27 @@ bool AnimationMixer::_update_caches() { track_value->is_continuous |= anim->value_track_get_update_mode(i) != Animation::UPDATE_DISCRETE; track_value->is_using_angle |= anim->track_get_interpolation_type(i) == Animation::INTERPOLATION_LINEAR_ANGLE || anim->track_get_interpolation_type(i) == Animation::INTERPOLATION_CUBIC_ANGLE; + // 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. + // Then, it should provide the correct precedence value. + switch (track_value->init_value.get_type()) { + case Variant::NIL: + case Variant::STRING_NAME: + case Variant::NODE_PATH: + case Variant::RID: + case Variant::OBJECT: + case Variant::CALLABLE: + case Variant::SIGNAL: + case Variant::DICTIONARY: + case Variant::ARRAY: { + 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."); + track_value->is_continuous = false; + break; + } + default: { + } + } + if (was_continuous != track_value->is_continuous) { WARN_PRINT_ONCE_ED("Value Track: " + String(path) + " has different update modes between some animations may be blended. Blending prioritizes UpdateMode.UPDATE_CONTINUOUS, so the process treat UpdateMode.UPDATE_DISCRETE as UpdateMode.UPDATE_CONTINUOUS with InterpolationType.INTERPOLATION_NEAREST."); } diff --git a/scene/animation/animation_player.cpp b/scene/animation/animation_player.cpp index 2d4f2cbceb..b3285d4cfc 100644 --- a/scene/animation/animation_player.cpp +++ b/scene/animation/animation_player.cpp @@ -544,12 +544,12 @@ bool AnimationPlayer::is_valid() const { } double AnimationPlayer::get_current_animation_position() const { - ERR_FAIL_COND_V_MSG(!playback.current.from, 0, "AnimationPlayer has no current animation"); + ERR_FAIL_NULL_V_MSG(playback.current.from, 0, "AnimationPlayer has no current animation."); return playback.current.pos; } double AnimationPlayer::get_current_animation_length() const { - ERR_FAIL_COND_V_MSG(!playback.current.from, 0, "AnimationPlayer has no current animation"); + ERR_FAIL_NULL_V_MSG(playback.current.from, 0, "AnimationPlayer has no current animation."); return playback.current.from->animation->get_length(); } diff --git a/scene/animation/tween.cpp b/scene/animation/tween.cpp index 1b8c410101..c778129eb6 100644 --- a/scene/animation/tween.cpp +++ b/scene/animation/tween.cpp @@ -675,7 +675,7 @@ bool CallbackTweener::step(double &r_delta) { return false; } - if (!callback.get_object()) { + if (!callback.is_valid()) { return false; } @@ -740,7 +740,7 @@ bool MethodTweener::step(double &r_delta) { return false; } - if (!callback.get_object()) { + if (!callback.is_valid()) { return false; } |
