Resample Animations, losslessly deduplicating keyframes to reduce file size. Duplicate keyframes are commonly present in animation 'baked' by the authoring software to apply IK constraints or other software-specific features. Based on THREE.KeyframeTrack.optimize().
Result: (0,0,0,0,1,1,1,0,0,0,0,0,0,0) → (0,0,1,1,0,0)
Example:
import { ready, resample } from 'keyframe-resample';
// JavaScript (slower)
await document.transform(resample());
// WebAssembly (faster)
await document.transform(resample({ ready, resample }));
Made by Don McCurdy • Documented with greendoc • © 2023 MIT License
resample