@needle-tools/gltf-build-pipeline 2.15.1 → 2.15.2
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/dist/cli/index.js
CHANGED
|
@@ -172,6 +172,9 @@ Each version will be compressed and written to the output directory.
|
|
|
172
172
|
verbose,
|
|
173
173
|
useCache,
|
|
174
174
|
logger: logger,
|
|
175
|
+
// When progressive ran first, inputFile points to the progressive output copy.
|
|
176
|
+
// Pass the original source path so extensions can resolve sibling assets (e.g. .exr files).
|
|
177
|
+
sourceFile: progressive_results.length > 0 ? file : undefined,
|
|
175
178
|
};
|
|
176
179
|
// If we have produced progressive assets then the array already contains the input
|
|
177
180
|
if (progressive_results.length > 0) {
|
|
@@ -9,6 +9,8 @@ export type PackGLTFOptions = {
|
|
|
9
9
|
logger?: ILogger;
|
|
10
10
|
debug: boolean;
|
|
11
11
|
verbose?: boolean;
|
|
12
|
+
/** Original source file path, used to resolve external assets (e.g. .exr files) when inputFile differs from the source (e.g. after progressive transform) */
|
|
13
|
+
sourceFile?: string;
|
|
12
14
|
};
|
|
13
15
|
/** Compress a glTF file
|
|
14
16
|
*/
|
|
@@ -67,8 +67,10 @@ export async function packGLTF(inputFile, outputFile, options) {
|
|
|
67
67
|
'meshopt.encoder': MeshoptEncoder,
|
|
68
68
|
});
|
|
69
69
|
// Set input file path so extensions can resolve external EXR files
|
|
70
|
-
|
|
71
|
-
|
|
70
|
+
// Use sourceFile when available (e.g. when inputFile is a progressive output copy)
|
|
71
|
+
const assetSourceFile = options.sourceFile ?? inputFile;
|
|
72
|
+
NEEDLE_lightmaps_ext.inputFile = assetSourceFile;
|
|
73
|
+
setOpaqueInputFile(assetSourceFile);
|
|
72
74
|
const document = await ioTryReadWithMissingResources(io, inputFile);
|
|
73
75
|
if (options.logger) {
|
|
74
76
|
document.setLogger(options.logger);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "2.15.
|
|
1
|
+
export declare const version = "2.15.2";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = "2.15.
|
|
1
|
+
export const version = "2.15.2";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@needle-tools/gltf-build-pipeline",
|
|
3
|
-
"version": "2.15.
|
|
3
|
+
"version": "2.15.2",
|
|
4
4
|
"description": "Pipeline and tools for optimizing gltf files using gltf-transform and compression settings within glTF extensions",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"type": "module",
|