@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.
- package/CHANGELOG.md +520 -517
- package/README.md +38 -38
- package/dist/cache/cache.d.ts +55 -55
- package/dist/cache/cache.js +326 -326
- package/dist/cache/index.d.ts +1 -1
- package/dist/cache/index.js +1 -1
- package/dist/cli/index.d.ts +2 -2
- package/dist/cli/index.js +198 -198
- package/dist/config/index.d.ts +53 -53
- package/dist/config/index.js +152 -152
- package/dist/constants.d.ts +7 -7
- package/dist/constants.js +7 -7
- package/dist/extensions/NEEDLE_compression_texture/NEEDLE_compression_texture.d.ts +24 -24
- package/dist/extensions/NEEDLE_compression_texture/NEEDLE_compression_texture.js +54 -54
- package/dist/extensions/NEEDLE_compression_texture/index.d.ts +1 -1
- package/dist/extensions/NEEDLE_compression_texture/index.js +1 -1
- package/dist/extensions/NEEDLE_mesh_compression/NEEDLE_mesh_compression.d.ts +27 -27
- package/dist/extensions/NEEDLE_mesh_compression/NEEDLE_mesh_compression.js +88 -88
- package/dist/extensions/NEEDLE_mesh_compression/index.d.ts +1 -1
- package/dist/extensions/NEEDLE_mesh_compression/index.js +1 -1
- package/dist/extensions/NEEDLE_opaque/NEEDLE_opaque.d.ts +27 -27
- package/dist/extensions/NEEDLE_opaque/NEEDLE_opaque.js +980 -980
- package/dist/extensions/NEEDLE_opaque/index.d.ts +3 -3
- package/dist/extensions/NEEDLE_opaque/index.js +30 -30
- package/dist/extensions/NEEDLE_progressive/NEEDLE_progressive.d.ts +48 -48
- package/dist/extensions/NEEDLE_progressive/NEEDLE_progressive.js +69 -69
- package/dist/extensions/NEEDLE_progressive/index.d.ts +1 -1
- package/dist/extensions/NEEDLE_progressive/index.js +1 -1
- package/dist/extensions/NEEDLE_progressive_mesh_settings/index.d.ts +23 -23
- package/dist/extensions/NEEDLE_progressive_mesh_settings/index.js +41 -41
- package/dist/extensions/NEEDLE_progressive_texture_settings/index.d.ts +25 -25
- package/dist/extensions/NEEDLE_progressive_texture_settings/index.js +38 -38
- package/dist/extensions/index.d.ts +7 -7
- package/dist/extensions/index.js +17 -17
- package/dist/extensions/utils.d.ts +6 -6
- package/dist/extensions/utils.js +72 -72
- package/dist/functions/weld.3.d.ts +76 -76
- package/dist/functions/weld.3.js +414 -414
- package/dist/index.d.ts +8 -8
- package/dist/index.js +8 -8
- package/dist/scripts/index.d.ts +2 -2
- package/dist/scripts/index.js +2 -2
- package/dist/scripts/pack-gltf.d.ts +15 -15
- package/dist/scripts/pack-gltf.js +135 -133
- package/dist/scripts/stats.d.ts +2 -2
- package/dist/scripts/stats.js +19 -19
- package/dist/transforms/index.d.ts +9 -9
- package/dist/transforms/index.js +9 -9
- package/dist/transforms/needle_animation_transform.d.ts +2 -2
- package/dist/transforms/needle_animation_transform.js +5 -5
- package/dist/transforms/needle_asset.d.ts +3 -3
- package/dist/transforms/needle_asset.js +50 -50
- package/dist/transforms/needle_common.d.ts +17 -17
- package/dist/transforms/needle_common.js +1 -1
- package/dist/transforms/needle_mesh_transform.d.ts +15 -15
- package/dist/transforms/needle_mesh_transform.js +223 -223
- package/dist/transforms/needle_progressive.d.ts +45 -45
- package/dist/transforms/needle_progressive.js +1043 -1043
- package/dist/transforms/needle_texture_transform.d.ts +13 -13
- package/dist/transforms/needle_texture_transform.js +257 -257
- package/dist/transforms/needle_toktx.d.ts +26 -26
- package/dist/transforms/needle_toktx.js +243 -243
- package/dist/transforms/needle_webp.d.ts +15 -15
- package/dist/transforms/needle_webp.js +53 -53
- package/dist/transforms/toktx.d.ts +52 -52
- package/dist/transforms/toktx.js +221 -221
- package/dist/transforms/toktx_types.d.ts +78 -78
- package/dist/transforms/toktx_types.js +62 -62
- package/dist/transforms/util.d.ts +21 -21
- package/dist/transforms/util.js +90 -90
- package/dist/utils/compression_utils.d.ts +2 -2
- package/dist/utils/compression_utils.js +6 -6
- package/dist/utils/fileutils.d.ts +19 -19
- package/dist/utils/fileutils.js +177 -177
- package/dist/utils/guid.d.ts +1 -1
- package/dist/utils/guid.js +5 -5
- package/dist/utils/index.d.ts +10 -10
- package/dist/utils/index.js +10 -10
- package/dist/utils/merge.d.ts +12 -12
- package/dist/utils/merge.js +31 -31
- package/dist/utils/mesh.d.ts +13 -13
- package/dist/utils/mesh.js +124 -124
- package/dist/utils/nodeio.d.ts +6 -6
- package/dist/utils/nodeio.js +86 -86
- package/dist/utils/stats.d.ts +70 -70
- package/dist/utils/stats.js +258 -258
- package/dist/utils/texture.d.ts +5 -5
- package/dist/utils/texture.js +14 -14
- package/dist/utils/validate.d.ts +5 -5
- package/dist/utils/validate.js +17 -17
- package/dist/utils/version.d.ts +1 -1
- package/dist/utils/version.gen.d.ts +1 -1
- package/dist/utils/version.gen.js +1 -1
- package/dist/utils/version.js +4 -4
- package/package.json +79 -79
- package/scripts/clear-caches.mjs +3 -3
- package/scripts/defaults.mjs +11 -11
- package/scripts/fileutils.mjs +5 -5
- package/scripts/index.mjs +41 -41
- package/scripts/limit-caches.mjs +3 -3
- package/scripts/make-progressive.mjs +16 -16
- package/scripts/pack-gltf.mjs +106 -106
- 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
|
+
|
package/dist/cache/cache.d.ts
CHANGED
|
@@ -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;
|