@needle-tools/gltf-build-pipeline 1.5.0-alpha.2 → 1.5.0-alpha.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,7 +4,8 @@ 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.5.0-alpha.2] - 2023-05-03
7
+ ## [1.5.0-alpha.3] - 2023-05-03
8
+ - add: VRM progressive textures support
8
9
  - fix: VRM format should be saved as GLB. See https://github.com/donmccurdy/glTF-Transform/issues/1390
9
10
  - fix: VRM texture index handling
10
11
 
@@ -38,7 +38,7 @@ function registerExtensions(io) {
38
38
  ]);
39
39
  }
40
40
  async function onProcess(file, opts) {
41
- if (!file.endsWith(".glb") && !file.endsWith(".gltf")) {
41
+ if (!file.endsWith(".glb") && !file.endsWith(".gltf") && !file.endsWith(".vrm")) {
42
42
  console.log("ERR: file is not gltf/glb");
43
43
  return;
44
44
  }
@@ -71,7 +71,18 @@ async function onProcess(file, opts) {
71
71
  }
72
72
  //@ts-ignore
73
73
  document.getLogger().verbosity = 0;
74
- await document.transform(needle_asset(), make_progressive_textures(file, { size: [256, 256] }, opts), make_progressive_meshes(file, {}, opts), sparse());
74
+ const transforms = [
75
+ needle_asset(),
76
+ make_progressive_textures(file, { size: [256, 256] }, opts),
77
+ sparse(),
78
+ ];
79
+ // TODO: progressive meshes aren't supported yet for VRMs
80
+ if (!file.endsWith(".vrm")) {
81
+ transforms.push(make_progressive_meshes(file, {}, opts));
82
+ }
83
+ else
84
+ console.warn("WARN: Progressive meshes are not supported for VRM files yet");
85
+ await document.transform(...transforms);
75
86
  let filename = file;
76
87
  if (opts.debug === true) {
77
88
  // get extension
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@needle-tools/gltf-build-pipeline",
3
- "version": "1.5.0-alpha.2",
3
+ "version": "1.5.0-alpha.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",