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]
Made by Don McCurdy • Documented with greendoc • © 2023 MIT License
dedup