Skip to content

Commit e8c2ede

Browse files
committed
Fix Bezier track init value on caching
1 parent d6385d7 commit e8c2ede

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

scene/animation/animation_mixer.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -691,7 +691,9 @@ bool AnimationMixer::_update_caches() {
691691

692692
track = track_value;
693693

694-
track_value->init_value = anim->track_get_key_value(i, 0);
694+
bool is_value = track_src_type == Animation::TYPE_VALUE;
695+
696+
track_value->init_value = is_value ? anim->track_get_key_value(i, 0) : (anim->track_get_key_value(i, 0).operator Array())[0];
695697
track_value->init_value.zero();
696698

697699
track_value->is_init = false;
@@ -703,7 +705,7 @@ bool AnimationMixer::_update_caches() {
703705
if (has_reset_anim) {
704706
int rt = reset_anim->find_track(path, track_src_type);
705707
if (rt >= 0) {
706-
if (track_src_type == Animation::TYPE_VALUE) {
708+
if (is_value) {
707709
if (reset_anim->track_get_key_count(rt) > 0) {
708710
track_value->init_value = reset_anim->track_get_key_value(rt, 0);
709711
}

0 commit comments

Comments
 (0)