• 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)


    import { ready, resample } from 'keyframe-resample';
    // JavaScript (slower)
    await document.transform(resample());
    // WebAssembly (faster)
    await document.transform(resample({ ready, resample }));
Function symbol, where the argument and output are a box labeled 'glTF'.

Made by Don McCurdy. Documentation built with greendoc and published under Creative Commons Attribution 3.0.