@needle-tools/gltf-build-pipeline 2.15.0 → 2.15.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/dist/cli/index.js CHANGED
@@ -40,7 +40,7 @@ Caches are limited to ${cacheSizeLimit} MB disc space by default.
40
40
  const stats = await calculateStats(file);
41
41
  filestats.push(stats);
42
42
  });
43
- let output = args.ourput?.toString();
43
+ let output = args.output?.toString();
44
44
  if (!output) {
45
45
  if (isDirectory(input)) {
46
46
  output = path.join(input, "stats.needle.json");
@@ -32,7 +32,11 @@ class Stats {
32
32
  copyright: asset.copyright,
33
33
  extras: asset.extras,
34
34
  };
35
- const report = inspect(document);
35
+ let report = null;
36
+ try {
37
+ report = inspect(document);
38
+ }
39
+ catch { /* e.g. unsupported KTX2 colorModel */ }
36
40
  this.size = size;
37
41
  this.json = calculateJSONDocumentInfo(json);
38
42
  this.nodes = root.listNodes().length;
@@ -163,8 +167,8 @@ function calculateMeshInfo(document, report) {
163
167
  const meshes = root.listMeshes();
164
168
  const res = new MeshInfo();
165
169
  res.count = meshes.length;
166
- res.errors = report.meshes.errors;
167
- res.warnings = report.meshes.warnings;
170
+ res.errors = report?.meshes.errors;
171
+ res.warnings = report?.meshes.warnings;
168
172
  for (const mesh of root.listMeshes()) {
169
173
  const primitives = mesh.listPrimitives();
170
174
  res.primitives += primitives.length;
@@ -209,15 +213,18 @@ function calculateTextureInfo(document, report) {
209
213
  const res = new TextureInfo();
210
214
  res.count = textures.length;
211
215
  res.formats = textures.map(t => t.getMimeType());
212
- res.errors = report.textures.errors;
213
- res.warnings = report.textures.warnings;
216
+ res.errors = report?.textures.errors;
217
+ res.warnings = report?.textures.warnings;
214
218
  res.gpu_memory = 0;
215
219
  res.memory = 0;
216
220
  for (const texture of textures) {
217
221
  const image = texture.getImage();
218
222
  const mimetype = texture.getMimeType();
219
223
  if (image && mimetype) {
220
- res.gpu_memory += ImageUtils.getVRAMByteLength(image, mimetype);
224
+ try {
225
+ res.gpu_memory += ImageUtils.getVRAMByteLength(image, mimetype);
226
+ }
227
+ catch { /* unsupported KTX2 colorModel (e.g. ASTC HDR) */ }
221
228
  res.memory += image.byteLength;
222
229
  }
223
230
  }
@@ -1 +1 @@
1
- export declare const version = "2.15.0";
1
+ export declare const version = "2.15.1";
@@ -1 +1 @@
1
- export const version = "2.15.0";
1
+ export const version = "2.15.1";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@needle-tools/gltf-build-pipeline",
3
- "version": "2.15.0",
3
+ "version": "2.15.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",