@needle-tools/gltf-build-pipeline 2.13.0 → 2.13.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.
Files changed (103) hide show
  1. package/CHANGELOG.md +520 -517
  2. package/README.md +38 -38
  3. package/dist/cache/cache.d.ts +55 -55
  4. package/dist/cache/cache.js +326 -326
  5. package/dist/cache/index.d.ts +1 -1
  6. package/dist/cache/index.js +1 -1
  7. package/dist/cli/index.d.ts +2 -2
  8. package/dist/cli/index.js +198 -198
  9. package/dist/config/index.d.ts +53 -53
  10. package/dist/config/index.js +152 -152
  11. package/dist/constants.d.ts +7 -7
  12. package/dist/constants.js +7 -7
  13. package/dist/extensions/NEEDLE_compression_texture/NEEDLE_compression_texture.d.ts +24 -24
  14. package/dist/extensions/NEEDLE_compression_texture/NEEDLE_compression_texture.js +54 -54
  15. package/dist/extensions/NEEDLE_compression_texture/index.d.ts +1 -1
  16. package/dist/extensions/NEEDLE_compression_texture/index.js +1 -1
  17. package/dist/extensions/NEEDLE_mesh_compression/NEEDLE_mesh_compression.d.ts +27 -27
  18. package/dist/extensions/NEEDLE_mesh_compression/NEEDLE_mesh_compression.js +88 -88
  19. package/dist/extensions/NEEDLE_mesh_compression/index.d.ts +1 -1
  20. package/dist/extensions/NEEDLE_mesh_compression/index.js +1 -1
  21. package/dist/extensions/NEEDLE_opaque/NEEDLE_opaque.d.ts +27 -27
  22. package/dist/extensions/NEEDLE_opaque/NEEDLE_opaque.js +980 -980
  23. package/dist/extensions/NEEDLE_opaque/index.d.ts +3 -3
  24. package/dist/extensions/NEEDLE_opaque/index.js +30 -30
  25. package/dist/extensions/NEEDLE_progressive/NEEDLE_progressive.d.ts +48 -48
  26. package/dist/extensions/NEEDLE_progressive/NEEDLE_progressive.js +69 -69
  27. package/dist/extensions/NEEDLE_progressive/index.d.ts +1 -1
  28. package/dist/extensions/NEEDLE_progressive/index.js +1 -1
  29. package/dist/extensions/NEEDLE_progressive_mesh_settings/index.d.ts +23 -23
  30. package/dist/extensions/NEEDLE_progressive_mesh_settings/index.js +41 -41
  31. package/dist/extensions/NEEDLE_progressive_texture_settings/index.d.ts +25 -25
  32. package/dist/extensions/NEEDLE_progressive_texture_settings/index.js +38 -38
  33. package/dist/extensions/index.d.ts +7 -7
  34. package/dist/extensions/index.js +17 -17
  35. package/dist/extensions/utils.d.ts +6 -6
  36. package/dist/extensions/utils.js +72 -72
  37. package/dist/functions/weld.3.d.ts +76 -76
  38. package/dist/functions/weld.3.js +414 -414
  39. package/dist/index.d.ts +8 -8
  40. package/dist/index.js +8 -8
  41. package/dist/scripts/index.d.ts +2 -2
  42. package/dist/scripts/index.js +2 -2
  43. package/dist/scripts/pack-gltf.d.ts +15 -15
  44. package/dist/scripts/pack-gltf.js +135 -133
  45. package/dist/scripts/stats.d.ts +2 -2
  46. package/dist/scripts/stats.js +19 -19
  47. package/dist/transforms/index.d.ts +9 -9
  48. package/dist/transforms/index.js +9 -9
  49. package/dist/transforms/needle_animation_transform.d.ts +2 -2
  50. package/dist/transforms/needle_animation_transform.js +5 -5
  51. package/dist/transforms/needle_asset.d.ts +3 -3
  52. package/dist/transforms/needle_asset.js +50 -50
  53. package/dist/transforms/needle_common.d.ts +17 -17
  54. package/dist/transforms/needle_common.js +1 -1
  55. package/dist/transforms/needle_mesh_transform.d.ts +15 -15
  56. package/dist/transforms/needle_mesh_transform.js +223 -223
  57. package/dist/transforms/needle_progressive.d.ts +45 -45
  58. package/dist/transforms/needle_progressive.js +1043 -1043
  59. package/dist/transforms/needle_texture_transform.d.ts +13 -13
  60. package/dist/transforms/needle_texture_transform.js +257 -257
  61. package/dist/transforms/needle_toktx.d.ts +26 -26
  62. package/dist/transforms/needle_toktx.js +243 -243
  63. package/dist/transforms/needle_webp.d.ts +15 -15
  64. package/dist/transforms/needle_webp.js +53 -53
  65. package/dist/transforms/toktx.d.ts +52 -52
  66. package/dist/transforms/toktx.js +221 -221
  67. package/dist/transforms/toktx_types.d.ts +78 -78
  68. package/dist/transforms/toktx_types.js +62 -62
  69. package/dist/transforms/util.d.ts +21 -21
  70. package/dist/transforms/util.js +90 -90
  71. package/dist/utils/compression_utils.d.ts +2 -2
  72. package/dist/utils/compression_utils.js +6 -6
  73. package/dist/utils/fileutils.d.ts +19 -19
  74. package/dist/utils/fileutils.js +177 -177
  75. package/dist/utils/guid.d.ts +1 -1
  76. package/dist/utils/guid.js +5 -5
  77. package/dist/utils/index.d.ts +10 -10
  78. package/dist/utils/index.js +10 -10
  79. package/dist/utils/merge.d.ts +12 -12
  80. package/dist/utils/merge.js +31 -31
  81. package/dist/utils/mesh.d.ts +13 -13
  82. package/dist/utils/mesh.js +124 -124
  83. package/dist/utils/nodeio.d.ts +6 -6
  84. package/dist/utils/nodeio.js +86 -86
  85. package/dist/utils/stats.d.ts +70 -70
  86. package/dist/utils/stats.js +258 -258
  87. package/dist/utils/texture.d.ts +5 -5
  88. package/dist/utils/texture.js +14 -14
  89. package/dist/utils/validate.d.ts +5 -5
  90. package/dist/utils/validate.js +17 -17
  91. package/dist/utils/version.d.ts +1 -1
  92. package/dist/utils/version.gen.d.ts +1 -1
  93. package/dist/utils/version.gen.js +1 -1
  94. package/dist/utils/version.js +4 -4
  95. package/package.json +79 -79
  96. package/scripts/clear-caches.mjs +3 -3
  97. package/scripts/defaults.mjs +11 -11
  98. package/scripts/fileutils.mjs +5 -5
  99. package/scripts/index.mjs +41 -41
  100. package/scripts/limit-caches.mjs +3 -3
  101. package/scripts/make-progressive.mjs +16 -16
  102. package/scripts/pack-gltf.mjs +106 -106
  103. package/tsconfig.json +19 -19
package/README.md CHANGED
@@ -1,38 +1,38 @@
1
- # glTF Build Pipeline
2
-
3
- Creating optimized glTF, GLB and VRM files for the web.
4
-
5
- Includes support for generating LOD quality level for textures and meshes. Use with [@needle-tools/gltf-progressive](https://www.npmjs.com/package/@needle-tools/gltf-progressive)
6
-
7
- ## Examples
8
-
9
- - [Example on Github](https://github.com/needle-engine/progressive-meshes-sample)
10
-
11
-
12
- ## Usage
13
-
14
- In general all files that have been processed by this package are valid glTF/GLB files.
15
- The glTF Build Pipeline package is meant to be used as a last step before delivery.
16
- That means:
17
- - files are meant to be loaded e.g. in a web runtime like three.js
18
- - files are not to be opened in Blender again to be further edited
19
-
20
- To load progressively enhanced glTF files in any three.js based engine see examples at [@needle-tools/gltf-progressive](https://www.npmjs.com/package/@needle-tools/gltf-progressive)
21
-
22
- ### Installation
23
-
24
- `npx @needle-tools/gltf-build-pipeline@latest`
25
-
26
- ### Commands
27
- - `help` - use help to view options
28
-
29
- # Contact
30
-
31
- For licensing questions please contact us.
32
-
33
- <b>[🌵 Needle](https://needle.tools)</b> •
34
- [Email](mailto:hi@needle.tools) •
35
- [Twitter](https://twitter.com/NeedleTools) •
36
- [Discord](https://discord.needle.tools) •
37
- [Forum](https://forum.needle.tools)
38
-
1
+ # glTF Build Pipeline
2
+
3
+ Creating optimized glTF, GLB and VRM files for the web.
4
+
5
+ Includes support for generating LOD quality level for textures and meshes. Use with [@needle-tools/gltf-progressive](https://www.npmjs.com/package/@needle-tools/gltf-progressive)
6
+
7
+ ## Examples
8
+
9
+ - [Example on Github](https://github.com/needle-engine/progressive-meshes-sample)
10
+
11
+
12
+ ## Usage
13
+
14
+ In general all files that have been processed by this package are valid glTF/GLB files.
15
+ The glTF Build Pipeline package is meant to be used as a last step before delivery.
16
+ That means:
17
+ - files are meant to be loaded e.g. in a web runtime like three.js
18
+ - files are not to be opened in Blender again to be further edited
19
+
20
+ To load progressively enhanced glTF files in any three.js based engine see examples at [@needle-tools/gltf-progressive](https://www.npmjs.com/package/@needle-tools/gltf-progressive)
21
+
22
+ ### Installation
23
+
24
+ `npx @needle-tools/gltf-build-pipeline@latest`
25
+
26
+ ### Commands
27
+ - `help` - use help to view options
28
+
29
+ # Contact
30
+
31
+ For licensing questions please contact us.
32
+
33
+ <b>[🌵 Needle](https://needle.tools)</b> •
34
+ [Email](mailto:hi@needle.tools) •
35
+ [Twitter](https://twitter.com/NeedleTools) •
36
+ [Discord](https://discord.needle.tools) •
37
+ [Forum](https://forum.needle.tools)
38
+
@@ -1,55 +1,55 @@
1
- /// <reference types="node" resolution-mode="require"/>
2
- import { ExtensibleProperty } from "@gltf-transform/core";
3
- import { Logger } from "@donmccurdy/caporal";
4
- /**
5
- * Clear the cache.
6
- * This will remove all files in the cache directory.
7
- */
8
- export declare function clearCache(logger?: Logger): void;
9
- export declare const cacheSizeLimit: number;
10
- /**
11
- * Ensure that the cache size does not exceed the given maximum size in MB.
12
- * @param maxSizeMB The maximum size in MB.
13
- */
14
- export declare function limitCacheSize(maxSizeMB?: number): void;
15
- /**
16
- * Add data to the cache.
17
- * @param key The key to store the data under.
18
- * @param bytes The data to store as a Uint8Array.
19
- */
20
- export declare function addToCache(key: string, bytes: Uint8Array | Buffer): void;
21
- /**
22
- * Try to get the data from the cache.
23
- * @param key The key to look up.
24
- * @returns The data as a Uint8Array or null if not found.
25
- * @throws If the cache file is corrupted.
26
- */
27
- export declare function tryGetFromCache(key: string): Uint8Array | null;
28
- /** Add meta data to the cache.
29
- * @param key The key to store the meta data for.
30
- * @param meta The meta data object to store. It will be serialized to JSON and stored in a file with the key as the name with the extension ".meta".
31
- */
32
- export declare function addMetaToCache(key: string, meta: object): void;
33
- /** Try to get the meta data from the cache.
34
- * @param key The key to look up.
35
- * @param ignoreVersion If true, the version check is skipped. If false, the version must match the current build pipeline version.
36
- * @returns The meta data object or null if not found.
37
- */
38
- export declare function tryGetMetaFromCache(key: string, ignoreVersion?: boolean): object | null;
39
- /**
40
- * Get the cache key for a property.
41
- * @param property The property to get the key for.
42
- * @returns The key as a string.
43
- */
44
- export declare function getKey(property: ExtensibleProperty): string;
45
- export declare function getKeyWithHash(property: ExtensibleProperty): {
46
- key: string;
47
- hash: string;
48
- };
49
- /**
50
- * Get the hash for a property or an object.
51
- * @param property The property to get the hash for.
52
- * @param level The current level of recursion.
53
- * @returns The hash as a number.
54
- */
55
- export declare function getHash(property: ExtensibleProperty | object, level?: number): string;
1
+ /// <reference types="node" resolution-mode="require"/>
2
+ import { ExtensibleProperty } from "@gltf-transform/core";
3
+ import { Logger } from "@donmccurdy/caporal";
4
+ /**
5
+ * Clear the cache.
6
+ * This will remove all files in the cache directory.
7
+ */
8
+ export declare function clearCache(logger?: Logger): void;
9
+ export declare const cacheSizeLimit: number;
10
+ /**
11
+ * Ensure that the cache size does not exceed the given maximum size in MB.
12
+ * @param maxSizeMB The maximum size in MB.
13
+ */
14
+ export declare function limitCacheSize(maxSizeMB?: number): void;
15
+ /**
16
+ * Add data to the cache.
17
+ * @param key The key to store the data under.
18
+ * @param bytes The data to store as a Uint8Array.
19
+ */
20
+ export declare function addToCache(key: string, bytes: Uint8Array | Buffer): void;
21
+ /**
22
+ * Try to get the data from the cache.
23
+ * @param key The key to look up.
24
+ * @returns The data as a Uint8Array or null if not found.
25
+ * @throws If the cache file is corrupted.
26
+ */
27
+ export declare function tryGetFromCache(key: string): Uint8Array | null;
28
+ /** Add meta data to the cache.
29
+ * @param key The key to store the meta data for.
30
+ * @param meta The meta data object to store. It will be serialized to JSON and stored in a file with the key as the name with the extension ".meta".
31
+ */
32
+ export declare function addMetaToCache(key: string, meta: object): void;
33
+ /** Try to get the meta data from the cache.
34
+ * @param key The key to look up.
35
+ * @param ignoreVersion If true, the version check is skipped. If false, the version must match the current build pipeline version.
36
+ * @returns The meta data object or null if not found.
37
+ */
38
+ export declare function tryGetMetaFromCache(key: string, ignoreVersion?: boolean): object | null;
39
+ /**
40
+ * Get the cache key for a property.
41
+ * @param property The property to get the key for.
42
+ * @returns The key as a string.
43
+ */
44
+ export declare function getKey(property: ExtensibleProperty): string;
45
+ export declare function getKeyWithHash(property: ExtensibleProperty): {
46
+ key: string;
47
+ hash: string;
48
+ };
49
+ /**
50
+ * Get the hash for a property or an object.
51
+ * @param property The property to get the hash for.
52
+ * @param level The current level of recursion.
53
+ * @returns The hash as a number.
54
+ */
55
+ export declare function getHash(property: ExtensibleProperty | object, level?: number): string;