- Home /
How can I compress imported animations that didn't come from FBX?
I have a load of animations that I have imported into Unity: I wrote a simple importer that parsed our old animation format and generated the appropriate animation curves and clips in the Unity Editor. That all works but they do not show up as compressed and I cannot find anything in the Editor apis that would compress an AnimationCurve or AnimationClip. How should I compress animations imported from other than FBX?
Answer by Paulius-Liekis · May 22, 2012 at 07:04 PM
What do you mean "they do not show up compressed"? Your generated curves will have as much keys as you created.
When I import an animation as FBX the dialog offers me various options for keyframe reduction (also visible in the Editor class $$anonymous$$odelImporter). Is there a way I can get access to this keyframe reduction for animations that I have imported in code? Or do I have to cook up my own keyframe reduction? There is also a separate flag for compression (distinct from reduction) and I'm guessing this is the flag that shows when selecting an anim in the Editor. Is this also something I can get access to when saving an anim clip?
No, Unity does not give you access to keyframe reduction routines. No one asked so far :) most people simply control amount of keyframes when they create keyframes from code.
I'm not sure what you mean by "import animation from code".
I posted an idea to Unity feedback about this.
http://feedback.unity3d.com/unity/all-categories/1/hot/active/reduction-compress-animation-ap