@needle-tools/gltf-build-pipeline 1.4.2 → 1.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -4,8 +4,9 @@ All notable changes to this package will be documented in this file.
4
4
  The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
5
5
  and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
6
6
 
7
- ## [1.4.2] - 2023-04-02
7
+ ## [1.4.3] - 2023-04-02
8
8
  - release
9
+ - fix: generate cache key for meshes
9
10
 
10
11
  ## [1.4.1-beta.15] - 2023-04-02
11
12
  - fix: issue where discarding all LODs might result in broken mesh due to simplify having modified the original mesh
@@ -165,13 +165,17 @@ export function getHash(property) {
165
165
  const weights = property.getWeights();
166
166
  hash += hashObject(weights);
167
167
  const primitives = property.listPrimitives();
168
- hash += hashObject(primitives);
168
+ for (const prim of primitives)
169
+ hash += getHash(prim);
169
170
  }
170
171
  else if (property instanceof Primitive) {
171
172
  const indices = property.getIndices();
172
173
  const attributes = property.listAttributes();
173
174
  const targets = property.listTargets();
174
- const semantics = property.listSemantics();
175
+ // TODO: hash buffer view if possible
176
+ const semantics = property.listSemantics().map(s => {
177
+ return { name: s, array: property.getAttribute(s).getArray() };
178
+ });
175
179
  hash += hashObject({
176
180
  indices,
177
181
  attributes,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@needle-tools/gltf-build-pipeline",
3
- "version": "1.4.2",
3
+ "version": "1.4.3",
4
4
  "description": "Pipeline and tools for optimizing gltf files using gltf-transform and compression settings within glTF extensions",
5
5
  "main": "index.mjs",
6
6
  "type": "module",