@needle-tools/gltf-build-pipeline 1.0.5 → 1.0.6
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,9 @@ 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.0.6] - 2023-05-06
|
|
8
|
+
- fix: dont add textures to cache when toktx is not installed
|
|
9
|
+
|
|
7
10
|
## [1.0.5] - 2023-05-06
|
|
8
11
|
- fix: catch exception in cases where toktx is not installed (e.g. in CI environment) and log warning instead
|
|
9
12
|
|
|
@@ -6,7 +6,7 @@ export interface NeedleTransformContext {
|
|
|
6
6
|
noToktx: boolean;
|
|
7
7
|
}
|
|
8
8
|
export interface INeedleTextureTransformContext {
|
|
9
|
-
prepare(document: Document): Promise<void>;
|
|
9
|
+
prepare(document: Document): Promise<void | boolean>;
|
|
10
10
|
process(index: number, texture: Texture, settings: NEEDLE_compression_texture_schema): Promise<boolean>;
|
|
11
11
|
finalize(document: Document): Promise<void>;
|
|
12
12
|
}
|
|
@@ -131,8 +131,8 @@ async function processTexture(texture, index, document, logger, context) {
|
|
|
131
131
|
if (canRunToktx) {
|
|
132
132
|
// if no specific compression settings are provided we just use the toktx default settings
|
|
133
133
|
// if we ever change what is used for default compression we need to teach the cache to save the mime type
|
|
134
|
-
await context.toktxContext.process(index, texture, null);
|
|
135
|
-
|
|
134
|
+
successFullyProcessed = await context.toktxContext.process(index, texture, null);
|
|
135
|
+
// don't add textures to the cache when toktx doesnt run
|
|
136
136
|
}
|
|
137
137
|
else {
|
|
138
138
|
console.log("toktx is disallowed. Skipping texture compression.");
|
|
@@ -19,7 +19,7 @@ export declare class NeedleToktxContext implements INeedleTextureTransformContex
|
|
|
19
19
|
numTextures: number;
|
|
20
20
|
private _prepareFailed;
|
|
21
21
|
constructor(options: NeedleToktxOptions);
|
|
22
|
-
prepare(document: Document): Promise<
|
|
22
|
+
prepare(document: Document): Promise<boolean>;
|
|
23
23
|
process(index: number, texture: Texture, settings: NEEDLE_compression_texture_schema | null): Promise<boolean>;
|
|
24
24
|
finalize(document: Document): Promise<void>;
|
|
25
25
|
}
|
|
@@ -66,8 +66,9 @@ export class NeedleToktxContext {
|
|
|
66
66
|
const logger = document.getLogger();
|
|
67
67
|
this.version = await checkKTXSoftware(logger, this.env);
|
|
68
68
|
if (this.version === null) {
|
|
69
|
+
console.log("Will not run toktx transform");
|
|
69
70
|
this._prepareFailed = true;
|
|
70
|
-
return;
|
|
71
|
+
return false;
|
|
71
72
|
}
|
|
72
73
|
this.basisuExtension = document.createExtension(KHRTextureBasisu).setRequired(true);
|
|
73
74
|
const tmpDir = `${tmp.tmpdir}/gltf-transform`;
|
|
@@ -80,7 +81,9 @@ export class NeedleToktxContext {
|
|
|
80
81
|
console.error(e);
|
|
81
82
|
console.log("Error preparing toktx transform");
|
|
82
83
|
this._prepareFailed = true;
|
|
84
|
+
return false;
|
|
83
85
|
}
|
|
86
|
+
return true;
|
|
84
87
|
}
|
|
85
88
|
async process(index, texture, settings) {
|
|
86
89
|
const task = async () => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@needle-tools/gltf-build-pipeline",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.6",
|
|
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",
|