From e8c2edefd1b6140a7f4f5d2b24666bf82640c18a Mon Sep 17 00:00:00 2001 From: "Silc Lizard (Tokage) Renew" <61938263+TokageItLab@users.noreply.github.com> Date: Mon, 1 Jul 2024 01:15:08 +0900 Subject: [PATCH] Fix Bezier track init value on caching --- scene/animation/animation_mixer.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scene/animation/animation_mixer.cpp b/scene/animation/animation_mixer.cpp index c74348c2e7b6..e7626b3c2d9e 100644 --- a/scene/animation/animation_mixer.cpp +++ b/scene/animation/animation_mixer.cpp @@ -691,7 +691,9 @@ bool AnimationMixer::_update_caches() { track = track_value; - track_value->init_value = anim->track_get_key_value(i, 0); + bool is_value = track_src_type == Animation::TYPE_VALUE; + + track_value->init_value = is_value ? anim->track_get_key_value(i, 0) : (anim->track_get_key_value(i, 0).operator Array())[0]; track_value->init_value.zero(); track_value->is_init = false; @@ -703,7 +705,7 @@ bool AnimationMixer::_update_caches() { if (has_reset_anim) { int rt = reset_anim->find_track(path, track_src_type); if (rt >= 0) { - if (track_src_type == Animation::TYPE_VALUE) { + if (is_value) { if (reset_anim->track_get_key_count(rt) > 0) { track_value->init_value = reset_anim->track_get_key_value(rt, 0); }