dedup

  • Removes duplicate Accessor, Mesh, Texture, and Material properties. Partially based on a gist by mattdesl. Only accessors in mesh primitives, morph targets, and animation samplers are processed.

    Example:

    document.getRoot().listMeshes(); // → [Mesh, Mesh, Mesh]
    
    await document.transform(dedup({propertyTypes: [PropertyType.MESH]}));
    
    document.getRoot().listMeshes(); // → [Mesh]
    
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.