Merge pull request #4308 from JoshuaGrams/atp-resources

AnimationTreePlayer: fix discrete value tracks.
This commit is contained in:
Rémi Verschelde 2016-04-14 12:39:08 +02:00
commit 20f62dd958
2 changed files with 7 additions and 6 deletions

View File

@ -766,9 +766,8 @@ void AnimationTreePlayer::_process_animation(float p_delta) {
t.scale.y=0; t.scale.y=0;
t.scale.z=0; t.scale.z=0;
Variant value = t.object->get(t.property); t.value = t.object->get(t.property);
value.zero(); t.value.zero();
t.object->set(t.property, value);
} }
@ -815,9 +814,9 @@ void AnimationTreePlayer::_process_animation(float p_delta) {
case Animation::TYPE_VALUE: { ///< Set a value in a property, can be interpolated. case Animation::TYPE_VALUE: { ///< Set a value in a property, can be interpolated.
if (a->value_track_is_continuous(tr.local_track)) { if (a->value_track_is_continuous(tr.local_track)) {
Variant blended, value = a->value_track_interpolate(tr.local_track,anim_list->time); Variant value = a->value_track_interpolate(tr.local_track,anim_list->time);
Variant::blend(tr.track->object->get(tr.track->property),value,blend,blended); Variant::blend(tr.track->value,value,blend,tr.track->value);
tr.track->object->set(tr.track->property,blended); tr.track->object->set(tr.track->property,tr.track->value);
} else { } else {
List<int> indices; List<int> indices;

View File

@ -109,6 +109,8 @@ private:
Quat rot; Quat rot;
Vector3 scale; Vector3 scale;
Variant value;
}; };