Skip to content

Commit

Permalink
Fix Bezier track init value on caching
Browse files Browse the repository at this point in the history
  • Loading branch information
TokageItLab committed Jun 30, 2024
1 parent d6385d7 commit e8c2ede
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions scene/animation/animation_mixer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
}
Expand Down

0 comments on commit e8c2ede

Please sign in to comment.