summaryrefslogtreecommitdiff
path: root/scene/animation/animation_tree_player.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'scene/animation/animation_tree_player.cpp')
-rw-r--r--scene/animation/animation_tree_player.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/scene/animation/animation_tree_player.cpp b/scene/animation/animation_tree_player.cpp
index c1374f1046..b07611b318 100644
--- a/scene/animation/animation_tree_player.cpp
+++ b/scene/animation/animation_tree_player.cpp
@@ -769,6 +769,10 @@ void AnimationTreePlayer::_process_animation(float p_delta) {
t.scale.x=0;
t.scale.y=0;
t.scale.z=0;
+
+ Variant value = t.node->get(t.property);
+ value.zero();
+ t.node->set(t.property, value);
}
@@ -778,11 +782,9 @@ void AnimationTreePlayer::_process_animation(float p_delta) {
Quat empty_rot;
- int total = 0;
while(anim_list) {
if (!anim_list->animation.is_null() && !anim_list->skip) {
- ++total;
//check if animation is meaningful
Animation *a = anim_list->animation.operator->();
@@ -817,8 +819,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 value = a->value_track_interpolate(tr.local_track,anim_list->time);
- tr.track->node->set(tr.track->property,value);
+ Variant blended, value = a->value_track_interpolate(tr.local_track,anim_list->time);
+ Variant::blend(tr.track->node->get(tr.track->property),value,blend,blended);
+ tr.track->node->set(tr.track->property,blended);
} else {
List<int> indices;