- Home /
Remove unused animation curves? (Animation.Update() optimizing)
Hi,
Anyone out there know of a way to remove whole curves from animation clips that aren't being used? Meaning they are just sitting at the default transform value for the duration of the animation?
I'm trying to optimize Animation.Update(), and I was planning to write something that will remove unnecessary anim curves on import to reduce the number of times Animation.Update() has to check the curve values.
Also if anyone has any insight about why this is a waste of time, please let me know. The only issue I can think of is cases of transitioning between an animation that something is posed in, to an animation it isn't, and it not getting reset to zero. I would have to check all animation data for a character, and remove based on that maybe.
Answer by m9731526 · Nov 27, 2017 at 04:58 AM
To remove a curve from a clip, try AnimationUtility.SetEditorCurve(clip, binding, curve); .
If curve is null the curve will be removed. If a curve already exists for that property, it will be replaced.