@needle-tools/gltf-build-pipeline 1.4.10 → 1.4.11
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,10 @@ 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.4.11] - 2023-04-29
|
|
8
|
+
- add: NEEDLE_progressive mesh now run sparse transform
|
|
9
|
+
- change: cli params for debug and caching are now `--debug` and `--no-caching`
|
|
10
|
+
|
|
7
11
|
## [1.4.10] - 2023-04-23
|
|
8
12
|
- add: NEEDLE_progressive can now load and process already draco compressed meshes
|
|
9
13
|
|
|
@@ -21,7 +21,7 @@ export async function make_progressive(opts) {
|
|
|
21
21
|
console.log(`Progressive Transform: Ignore existing LOD file at ${f}`);
|
|
22
22
|
return;
|
|
23
23
|
}
|
|
24
|
-
await
|
|
24
|
+
await onProcess(f, opts);
|
|
25
25
|
});
|
|
26
26
|
}
|
|
27
27
|
function registerExtensions(io) {
|
|
@@ -37,7 +37,7 @@ function registerExtensions(io) {
|
|
|
37
37
|
// createOpaqueExtension(NEEDLE_mesh_compression.EXTENSION_NAME, [PropertyType.ROOT, PropertyType.MESH, PropertyType.PRIMITIVE]),
|
|
38
38
|
]);
|
|
39
39
|
}
|
|
40
|
-
async function
|
|
40
|
+
async function onProcess(file, opts) {
|
|
41
41
|
if (!file.endsWith(".glb") && !file.endsWith(".gltf")) {
|
|
42
42
|
console.log("ERR: file is not gltf/glb");
|
|
43
43
|
return;
|
|
@@ -722,6 +722,7 @@ async function createMeshLod(doc, basePath, level, mesh, meshInfo, guid, lodLeve
|
|
|
722
722
|
console.log(`[${NAME}] Pass compression format to mesh LOD ${level} → ${JSON.stringify(compressionExt.model)}`);
|
|
723
723
|
newDoc.getRoot().setExtension(NEEDLE_mesh_compression.EXTENSION_NAME, newProp);
|
|
724
724
|
}
|
|
725
|
+
await newDoc.transform(sparse());
|
|
725
726
|
const newIo = new NodeIO();
|
|
726
727
|
registerExtensions(newIo);
|
|
727
728
|
console.log(`[${NAME}] Write mesh LOD ${level} with to \"${fileName}\"`);
|
package/dist/utils/fileutils.js
CHANGED
|
@@ -48,6 +48,10 @@ export async function foreachGLTF(args, callback) {
|
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
async function testEntry(entry, callback, context) {
|
|
51
|
+
// ignore argument names (e.g. --debug)
|
|
52
|
+
if (entry.startsWith("--")) {
|
|
53
|
+
return false;
|
|
54
|
+
}
|
|
51
55
|
if (entry === "." || entry === "./") {
|
|
52
56
|
if (context.baseDirectory) {
|
|
53
57
|
entry = context.baseDirectory;
|
|
@@ -62,7 +66,7 @@ async function testEntry(entry, callback, context) {
|
|
|
62
66
|
// Try resolve potential relative path
|
|
63
67
|
const newPath = context.baseDirectory + "/" + entry;
|
|
64
68
|
if (existsSync(newPath) === false) {
|
|
65
|
-
console.log(`INFO: Resolved path failed: ${entry} -> ${newPath} (doesnt exist or is locked by another process)`);
|
|
69
|
+
console.log(`INFO: Resolved path failed: \"${entry}\" -> ${newPath} (doesnt exist or is locked by another process)`);
|
|
66
70
|
return;
|
|
67
71
|
}
|
|
68
72
|
else {
|
package/make-progressive.mjs
CHANGED
|
@@ -7,8 +7,8 @@ console.log(`[Needle Build Pipeline] transform to progressive — version ${getV
|
|
|
7
7
|
|
|
8
8
|
make_progressive({
|
|
9
9
|
path: args,
|
|
10
|
-
debug: args.includes("debug"),
|
|
11
|
-
useCache: args.includes("no-caching") === false,
|
|
10
|
+
debug: args.includes("--debug"),
|
|
11
|
+
useCache: args.includes("--no-caching") === false,
|
|
12
12
|
});
|
|
13
13
|
|
|
14
14
|
|
package/pack-gltf.mjs
CHANGED
|
@@ -58,12 +58,12 @@ if (debug) {
|
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
let allowCaching = true;
|
|
61
|
-
if (args.includes("no-caching")) {
|
|
61
|
+
if (args.includes("--no-caching")) {
|
|
62
62
|
console.log("Caching is disabled")
|
|
63
63
|
allowCaching = false;
|
|
64
64
|
}
|
|
65
65
|
else if (showHelp)
|
|
66
|
-
console.log("Caching is enabled, use \"no-caching\" to disable it");
|
|
66
|
+
console.log("Caching is enabled, use \"--no-caching\" to disable it");
|
|
67
67
|
|
|
68
68
|
const noToktx = args.includes("no-toktx");
|
|
69
69
|
if (noToktx)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@needle-tools/gltf-build-pipeline",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.11",
|
|
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",
|