From f7fad321886858dd05d06f1e2d57773a2b24f147 Mon Sep 17 00:00:00 2001 From: Josh Grams Date: Tue, 8 Mar 2016 06:38:19 -0500 Subject: [PATCH 1/2] Variant::blend: add Quat, fix Vector3. --- core/variant_op.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/core/variant_op.cpp b/core/variant_op.cpp index 5463e1cabbd..9887c50dd88 100644 --- a/core/variant_op.cpp +++ b/core/variant_op.cpp @@ -3461,12 +3461,18 @@ void Variant::blend(const Variant& a, const Variant& b, float c, Variant &r_dst) const Rect2 *rb = reinterpret_cast(b._data._mem); r_dst=Rect2(ra->pos + rb->pos * c, ra->size + rb->size * c); } return; - case VECTOR3:{ r_dst=*reinterpret_cast(a._data._mem)+*reinterpret_cast(b._data._mem)*c; } return; + case VECTOR3:{ r_dst=*reinterpret_cast(a._data._mem)+*reinterpret_cast(b._data._mem)*c; } return; case _AABB:{ const AABB *ra = reinterpret_cast(a._data._mem); const AABB *rb = reinterpret_cast(b._data._mem); r_dst=AABB(ra->pos + rb->pos * c, ra->size + rb->size * c); } return; + case QUAT:{ + Quat empty_rot; + const Quat *qa = reinterpret_cast(a._data._mem); + const Quat *qb = reinterpret_cast(b._data._mem); + r_dst=*qa * empty_rot.slerp(*qb,c); + } return; case COLOR:{ const Color *ca = reinterpret_cast(a._data._mem); const Color *cb = reinterpret_cast(b._data._mem); From 2fa200ff5380d03bf3f581c00ef202729983423f Mon Sep 17 00:00:00 2001 From: Josh Grams Date: Tue, 8 Mar 2016 17:23:32 -0500 Subject: [PATCH 2/2] AnimationTreePlayer: distinguish value tracks. If the node had a 3D Transform, the transform would always get written, even if the tracks on that node were supposed to be value tracks. --- scene/animation/animation_tree_player.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scene/animation/animation_tree_player.cpp b/scene/animation/animation_tree_player.cpp index b07611b3183..a66a2849ae7 100644 --- a/scene/animation/animation_tree_player.cpp +++ b/scene/animation/animation_tree_player.cpp @@ -861,8 +861,9 @@ void AnimationTreePlayer::_process_animation(float p_delta) { if (!t.node) continue; - //if (E->get()->t.type!=Animation::TYPE_TRANSFORM) - // continue; + + if(t.property) // value track; was applied in step 2 + continue; Transform xform; xform.basis=t.rot;