Skip to content
This repository has been archived by the owner on Sep 2, 2021. It is now read-only.

Commit

Permalink
Fixed KeyFrame tangents #19
Browse files Browse the repository at this point in the history
  • Loading branch information
ousttrue committed Aug 26, 2018
1 parent e49d922 commit e257033
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions Core/Scripts/IO/gltfImporter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -514,9 +514,9 @@ public static void ImportAnimation(ImporterContext ctx, AnimationClip clip)
{
var time = input[j];
var pos = output[j].ReverseZ();
curveX.AddKey(time, pos.x);
curveY.AddKey(time, pos.y);
curveZ.AddKey(time, pos.z);
curveX.AddKey(new Keyframe(time, pos.x, 0, 0));
curveY.AddKey(new Keyframe(time, pos.y, 0, 0));
curveZ.AddKey(new Keyframe(time, pos.z, 0, 0));
}

clip.SetCurve(relativePath, typeof(Transform), "localPosition.x", curveX);
Expand Down Expand Up @@ -550,11 +550,11 @@ public static void ImportAnimation(ImporterContext ctx, AnimationClip clip)
rot.w = -rot.w;
}
}
curveX.AddKey(new Keyframe(time, rot.x, 0, 0));
curveY.AddKey(new Keyframe(time, rot.y, 0, 0));
curveZ.AddKey(new Keyframe(time, rot.z, 0, 0));
curveW.AddKey(new Keyframe(time, rot.w, 0, 0));
last = rot;
curveX.AddKey(time, rot.x);
curveY.AddKey(time, rot.y);
curveZ.AddKey(time, rot.z);
curveW.AddKey(time, rot.w);
}

clip.SetCurve(relativePath, typeof(Transform), "localRotation.x", curveX);
Expand All @@ -577,9 +577,9 @@ public static void ImportAnimation(ImporterContext ctx, AnimationClip clip)
{
var time = input[j];
var scale = output[j];
curveX.AddKey(time, scale.x);
curveY.AddKey(time, scale.y);
curveZ.AddKey(time, scale.z);
curveX.AddKey(new Keyframe(time, scale.x, 0, 0));
curveY.AddKey(new Keyframe(time, scale.y, 0, 0));
curveZ.AddKey(new Keyframe(time, scale.z, 0, 0));
}

clip.SetCurve(relativePath, typeof(Transform), "localScale.x", curveX);
Expand Down

0 comments on commit e257033

Please sign in to comment.