diff options
author | Josh Grams <josh@qualdan.com> | 2016-04-12 11:54:17 -0400 |
---|---|---|
committer | Josh Grams <josh@qualdan.com> | 2016-04-12 11:54:17 -0400 |
commit | ee59b2053fd2ea4b9517028380f231f8f0c4b353 (patch) | |
tree | 9a33c5377b73ce36769741d377d79bea09711248 /scene/animation/animation_tree_player.cpp | |
parent | aabb0d9cbcebea1ce7ebe056c672a51dd6d816d9 (diff) | |
download | redot-engine-ee59b2053fd2ea4b9517028380f231f8f0c4b353.tar.gz |
AnimationTreePlayer: fix discrete value tracks.
Discrete value tracks don't update every frame (only when a new key is
reached). So we can't use the actual property value as an accumulator:
it will end up being zero most of the time.
Diffstat (limited to 'scene/animation/animation_tree_player.cpp')
-rw-r--r-- | scene/animation/animation_tree_player.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/scene/animation/animation_tree_player.cpp b/scene/animation/animation_tree_player.cpp index 8b20c0acd6..0add2dfcbf 100644 --- a/scene/animation/animation_tree_player.cpp +++ b/scene/animation/animation_tree_player.cpp @@ -766,9 +766,8 @@ void AnimationTreePlayer::_process_animation(float p_delta) { t.scale.y=0; t.scale.z=0; - Variant value = t.object->get(t.property); - value.zero(); - t.object->set(t.property, value); + t.value = t.object->get(t.property); + t.value.zero(); } @@ -815,9 +814,9 @@ void AnimationTreePlayer::_process_animation(float p_delta) { case Animation::TYPE_VALUE: { ///< Set a value in a property, can be interpolated. if (a->value_track_is_continuous(tr.local_track)) { - Variant blended, value = a->value_track_interpolate(tr.local_track,anim_list->time); - Variant::blend(tr.track->object->get(tr.track->property),value,blend,blended); - tr.track->object->set(tr.track->property,blended); + Variant value = a->value_track_interpolate(tr.local_track,anim_list->time); + Variant::blend(tr.track->value,value,blend,tr.track->value); + tr.track->object->set(tr.track->property,tr.track->value); } else { List<int> indices; |