summaryrefslogtreecommitdiff
path: root/scene/animation/animation_tree_player.cpp
diff options
context:
space:
mode:
authorJosh Grams <josh@qualdan.com>2016-04-24 04:39:32 -0400
committerJosh Grams <josh@qualdan.com>2016-04-24 04:39:32 -0400
commit2272824ee27eb98624d0296884582dbd4fbedb67 (patch)
tree0dd3e34b091534cc8bf4ed9cd6b59b855da25aeb /scene/animation/animation_tree_player.cpp
parent7d89a8b7481c1e172958010366b3735b6d000591 (diff)
AnimationTree: set value track property per frame, not per track.
Diffstat (limited to 'scene/animation/animation_tree_player.cpp')
-rw-r--r--scene/animation/animation_tree_player.cpp15
1 files changed, 5 insertions, 10 deletions
diff --git a/scene/animation/animation_tree_player.cpp b/scene/animation/animation_tree_player.cpp
index c732dd54cf..0117766f1a 100644
--- a/scene/animation/animation_tree_player.cpp
+++ b/scene/animation/animation_tree_player.cpp
@@ -816,16 +816,9 @@ void AnimationTreePlayer::_process_animation(float p_delta) {
if (a->value_track_is_continuous(tr.local_track)) {
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;
- a->value_track_get_key_indices(tr.local_track,anim_list->time,anim_list->step,&indices);
- for(List<int>::Element *E=indices.front();E;E=E->next()) {
-
- Variant value = a->track_get_key_value(tr.local_track,E->get());
- tr.track->object->set(tr.track->property,value);
- }
+ int index = a->track_find_key(tr.local_track,anim_list->time+anim_list->step);
+ tr.track->value = a->track_get_key_value(tr.local_track, index);
}
} break;
case Animation::TYPE_METHOD: { ///< Call any method on a specific node.
@@ -857,8 +850,10 @@ void AnimationTreePlayer::_process_animation(float p_delta) {
if (!t.object)
continue;
- if(t.property) // value track; was applied in step 2
+ if(t.property) { // value track
+ t.object->set(t.property,t.value);
continue;
+ }
Transform xform;
xform.basis=t.rot;