diff options
author | Rémi Verschelde <remi@verschelde.fr> | 2016-04-14 12:39:08 +0200 |
---|---|---|
committer | Rémi Verschelde <remi@verschelde.fr> | 2016-04-14 12:39:08 +0200 |
commit | 20f62dd9585cfda1f6d75a49ddd9bb0ce7803bb6 (patch) | |
tree | d38c65516a0107069f1cdedd7c4181786a273588 /scene/animation | |
parent | 67682b35b0e3057b2d630592815cd84596e741e3 (diff) | |
parent | ee59b2053fd2ea4b9517028380f231f8f0c4b353 (diff) |
Merge pull request #4308 from JoshuaGrams/atp-resources
AnimationTreePlayer: fix discrete value tracks.
Diffstat (limited to 'scene/animation')
-rw-r--r-- | scene/animation/animation_tree_player.cpp | 11 | ||||
-rw-r--r-- | scene/animation/animation_tree_player.h | 2 |
2 files changed, 7 insertions, 6 deletions
diff --git a/scene/animation/animation_tree_player.cpp b/scene/animation/animation_tree_player.cpp index ddd768f12f..c732dd54cf 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; diff --git a/scene/animation/animation_tree_player.h b/scene/animation/animation_tree_player.h index ce761fdb18..2e44d69aa1 100644 --- a/scene/animation/animation_tree_player.h +++ b/scene/animation/animation_tree_player.h @@ -109,6 +109,8 @@ private: Quat rot; Vector3 scale; + Variant value; + }; |