@needle-tools/gltf-build-pipeline 2.11.0 → 2.11.1

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,6 +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
+ ## [2.11.1] - 2025-08-06
8
+ - Fix: issue where caching didn't store pre-calculated primitive densities. This caused incorrect LOD level calculation at runtime due to missing data when processing the same files a second time with caching enabled.
9
+
7
10
  ## [2.11.0] - 2025-08-01
8
11
  - add: store densities per primitive
9
12
  - fix: exception during cache key calculation
package/dist/cli/index.js CHANGED
@@ -13,7 +13,7 @@ import { ERROR_CODES } from '../constants.js';
13
13
  // For testing / dev you can run `npm link` in the package directory
14
14
  // For removing the link run `npm rm --global @needle-tools/gltf-build-pipeline`
15
15
  program
16
- .command("version", "Print current verison")
16
+ .command("version", "Print current version")
17
17
  .action(async ({ logger }) => {
18
18
  logger.info(getVersion());
19
19
  })
@@ -476,7 +476,7 @@ async function resizeTexture(options, texture, logger, uri, slots) {
476
476
  const [maxWidth, maxHeight] = options.size;
477
477
  const [srcWidth, srcHeight] = texture.getSize();
478
478
  if (srcWidth <= maxWidth && srcHeight <= maxHeight) {
479
- logger.debug(`[${NAME}] Skipping, the texture is already smaller than the requested size ${maxWidth}x${maxHeight}}`);
479
+ logger.debug(`[${NAME}] Skipping, texture satisfies requested max size ${maxWidth}x${maxHeight}}`);
480
480
  return;
481
481
  }
482
482
  if (maxWidth <= 0 || maxHeight <= 0) {
@@ -996,7 +996,7 @@ async function createMeshLod(inputFileName, doc, basePath, level, mesh, meshInfo
996
996
  const sizeInMB = (bytes.byteLength / 1024 / 1024).toFixed(2);
997
997
  logger.info(`[${NAME}] Add LOD ${level} to cache (${sizeInMB} MB) for \"${mesh.getName()}\" as ${cacheKey}`);
998
998
  addToCache(cacheKey, bytes);
999
- addMetaToCache(cacheKey, { meshInfo: newMeshInformation, density: density });
999
+ addMetaToCache(cacheKey, { meshInfo: newMeshInformation, density: density, densities: densities });
1000
1000
  }
1001
1001
  return {
1002
1002
  level,
@@ -230,7 +230,7 @@ async function processTexture(texture, index, document, logger, context) {
230
230
  successfullyProcessed = await context.toktxContext.process(index, texture, options, context);
231
231
  }
232
232
  else {
233
- console.log("Toktx not found: Skipping texture compression: " + originalMimeType);
233
+ logger.warn("Toktx not found: Skipping texture compression: " + originalMimeType);
234
234
  }
235
235
  }
236
236
  if (context.useCache && successfullyProcessed && key) {
@@ -249,7 +249,7 @@ async function processTexture(texture, index, document, logger, context) {
249
249
  // we remove the original file (since it effectively gets replaced)
250
250
  // otherwise we dont touch the original file
251
251
  if (inDirectory == outDirectory && existsSync(originalPath)) {
252
- console.log(`INFO: Remove old texture \"${originalUri}\" → \"${newUri}\"`);
252
+ logger.info(`Removing old texture \"${originalUri}\" → \"${newUri}\"`);
253
253
  rmSync(originalPath);
254
254
  }
255
255
  }
@@ -1 +1 @@
1
- export declare const version = "2.11.0";
1
+ export declare const version = "2.11.1";
@@ -1 +1 @@
1
- export const version = "2.11.0";
1
+ export const version = "2.11.1";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@needle-tools/gltf-build-pipeline",
3
- "version": "2.11.0",
3
+ "version": "2.11.1",
4
4
  "description": "Pipeline and tools for optimizing gltf files using gltf-transform and compression settings within glTF extensions",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",