@needle-tools/gltf-build-pipeline 2.10.0-next → 2.10.0-next.cd026e0

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.
@@ -115,6 +115,8 @@ export class NeedleToktxContext {
115
115
  }
116
116
  if (slots.length > 0)
117
117
  logger.debug(`${prefix}: Slots → [${slots.join(', ')}]`);
118
+ else
119
+ logger.debug(`${prefix}: No slots, assuming default texture.`);
118
120
  let srcImage = texture.getImage();
119
121
  let srcExtension = texture.getURI()
120
122
  ? FileUtils.extension(texture.getURI())
@@ -134,7 +136,8 @@ export class NeedleToktxContext {
134
136
  dstSize[1] = ceilMultipleOfFour(dstSize[1]);
135
137
  logger.warn(`${prefix}: Resizing ${srcSize.join('x')} → ${dstSize.join('x')}px`);
136
138
  instance.resize(dstSize[0], dstSize[1], { fit: 'fill', kernel: TextureResizeFilter.LANCZOS3 });
137
- srcImage = BufferUtils.toView(await instance.toBuffer());
139
+ const buffer = await instance.toBuffer();
140
+ srcImage = BufferUtils.toView(new Uint8Array(buffer));
138
141
  srcExtension = 'png';
139
142
  srcMimeType = 'image/png';
140
143
  }
@@ -142,7 +145,8 @@ export class NeedleToktxContext {
142
145
  const inPath = tmpName + '.' + srcExtension;
143
146
  const outPath = tmpName + '.ktx2';
144
147
  // const inBytes = image.byteLength;
145
- await fs.writeFile(inPath, Buffer.from(srcImage));
148
+ const buffer = Buffer.from(srcImage);
149
+ await fs.writeFile(inPath, buffer);
146
150
  let mode = Mode.ETC1S;
147
151
  let quality = 128;
148
152
  let compression = 1;
@@ -1 +1 @@
1
- export declare const version = "2.10.0-next";
1
+ export declare const version = "2.10.0-next.cd026e0";
@@ -1 +1 @@
1
- export const version = "2.10.0-next";
1
+ export const version = "2.10.0-next.cd026e0";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@needle-tools/gltf-build-pipeline",
3
- "version": "2.10.0-next",
3
+ "version": "2.10.0-next.cd026e0",
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",
@@ -48,9 +48,9 @@
48
48
  },
49
49
  "dependencies": {
50
50
  "@donmccurdy/caporal": "~0.0.10",
51
- "@gltf-transform/core": "4.1.3",
52
- "@gltf-transform/extensions": "4.1.3",
53
- "@gltf-transform/functions": "4.1.3",
51
+ "@gltf-transform/core": "4.1.4",
52
+ "@gltf-transform/extensions": "4.1.4",
53
+ "@gltf-transform/functions": "4.1.4",
54
54
  "command-exists": "^1.2.9",
55
55
  "command-line-args": "^5.2.1",
56
56
  "draco3dgltf": "^1.5.3",