@needle-tools/gltf-build-pipeline 2.1.0-alpha.4 → 2.1.0-alpha.6

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,11 @@ 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.1.0-alpha.6] - 2023-06-04
8
+ - fix: errors when invoking npm scripts caused by the cli program
9
+ - fix: remove cache directory error
10
+ - fix: remove dedup for textures since this currently causes issues with gltf-progressive loading
11
+
7
12
  ## [2.1.0-alpha] - 2023-06-03
8
13
  - add: compression config support for high-level usecases that can be passed via commandline arguments or via config. Available options are currently `default`, `world` and `product`.
9
14
  - add: texture LODs can now be generated by passing in the path to a compression config. `--config <path/to/config.json>`
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@needle-tools/gltf-build-pipeline",
3
- "version": "2.1.0-alpha.4",
3
+ "version": "2.1.0-alpha.6",
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",
@@ -70,6 +70,8 @@ export function limitCacheSize(maxSizeMB = cacheSizeLimit) {
70
70
  const file = files.shift();
71
71
  if (!file)
72
72
  break;
73
+ if (fs.statSync(file.path).isDirectory())
74
+ continue;
73
75
  console.log(`Removing cache file ${file.path}...`);
74
76
  fs.rmSync(file.path);
75
77
  totalSize -= file.size;
@@ -1,5 +1,5 @@
1
1
  import path from 'path';
2
- import { Logger, NodeIO, Verbosity } from '@gltf-transform/core';
2
+ import { Logger, NodeIO, PropertyType, Verbosity } from '@gltf-transform/core';
3
3
  import { ALL_EXTENSIONS } from '@gltf-transform/extensions';
4
4
  import draco3d from 'draco3dgltf';
5
5
  import { existsSync, readFileSync, statSync, writeFileSync } from 'fs';
@@ -78,7 +78,8 @@ export async function packGLTF(inputFile, outputFile, options) {
78
78
  needle_mesh_transform({ file: inputFile, config }, { ratio: 0.75, error: 0.0005 }),
79
79
  needle_animation_transform({}),
80
80
  resample(),
81
- dedup(),
81
+ // Can not dedup "materials" because progressive textures will then assigned to the wrong material instance
82
+ dedup({ propertyTypes: [PropertyType.MESH, PropertyType.MATERIAL] }),
82
83
  // prune(),
83
84
  ];
84
85
  const isProgressiveAsset = isLOD(inputFile);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@needle-tools/gltf-build-pipeline",
3
- "version": "2.1.0-alpha.4",
3
+ "version": "2.1.0-alpha.6",
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",