Search Unity

Feedback Why does AnimationUtility.GetEditorCurve Return the most unoptimized version of a curve?

Discussion in 'Animation' started by Mockarutan, Dec 28, 2022.

  1. Mockarutan

    Mockarutan

    Joined:
    May 22, 2011
    Posts:
    159
    I'm using the this call: https://docs.unity3d.com/ScriptReference/AnimationUtility.GetEditorCurve.html
    I use it for some custom animation system for myself. The source curves in the AnimationClip is perfectly simple and just a normal 2-6 keypoints curve generally. When I export it to a standalone AnimationCurve it becomes a mess.

    This:


    Becomes this:


    Why? The curve data is right there in the editor in the optimized version! Is there a way to get the ACTUAL curve you look at in the animation editor?

    Edit: I realized one of them are the quaternion version of the same rotation animation. So is that the problem? In that case, can I get the euler version or a better quaternion version?