public static class AnimationCurveCompressorRemoves the keys a linear sampler would have produced anyway.
No guide page documents this yet — the page shows what the code says about itself.
Remarks
An exporter emits a key per frame per channel whether or not anything changed, so a thirty-second idle is nine hundred keys per track saying the same thing, and a limb that moves in a straight line for a second is thirty keys on a line through two of them. This pass keeps a key only where dropping it would move the sampled curve further than the caller is willing to accept.
Greedy, and it fits against the anchor rather than against the neighbours. Starting from a kept key, the span is extended one key at a time and every key inside it is re-checked against the straight line from the anchor to the candidate. Checking only the key being dropped is the version everybody writes first, and it lets error accumulate: each key is within tolerance of its own neighbours and the hundredth is a long way from where it started.
It works on AnimationClipData, not on a runtime clip. This is a content-build pass — doc 08's model compiler is where it belongs — and its output is the same record a build already writes, so nothing downstream needs to know it ran. Running it at load would spend a character's loading time recomputing an answer that never changes.
Methods (2)
public static AnimationClipData Compress(AnimationClipData data, CurveCompressionSettings settings, out CurveCompressionReport report)Compresses every channel of a clip.
public static AnimationClipData Compress(AnimationClipData data)Compresses with the default tolerances.
Used by (2)
- CompressionBenchmarksVixen.Benchmarks.Animation
- CompressionTestsVixen.Animation.Tests