@needle-tools/gltf-build-pipeline 2.11.3-next.9f96868 → 2.11.3
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
|
@@ -5,7 +5,9 @@ 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
7
|
## [2.11.3] - 2025-08-08
|
|
8
|
+
- Fix: texture compression settings not being applied correctly
|
|
8
9
|
- Change: CLI `transform` with `--progressive` does now ignore LOD files
|
|
10
|
+
- Change: Increase local cache size to 5 GB
|
|
9
11
|
|
|
10
12
|
## [2.11.2] - 2025-08-07
|
|
11
13
|
- Change: `product` usecase should not flatten/join objects
|
|
@@ -8,43 +8,14 @@ export class NEEDLE_progressive_texture_settings extends Extension {
|
|
|
8
8
|
const textureDefinitions = context.jsonDoc.json.textures;
|
|
9
9
|
if (!textureDefinitions)
|
|
10
10
|
return this;
|
|
11
|
-
const root = this.document.getRoot();
|
|
12
|
-
const textures = root.listTextures();
|
|
13
|
-
/**
|
|
14
|
-
* If a texture is used in multiple slots it only appears once in the gltf-transform list
|
|
15
|
-
* So we have to store the key and the index of the texture in the list
|
|
16
|
-
*/
|
|
17
|
-
const textureMap = new Map();
|
|
18
|
-
let offset = 0;
|
|
19
11
|
for (let i = 0; i < textureDefinitions.length; i++) {
|
|
20
12
|
const texDef = textureDefinitions[i];
|
|
21
13
|
if (texDef.extensions && texDef.extensions[EXTENSION_NAME]) {
|
|
22
14
|
const ext = texDef.extensions[EXTENSION_NAME];
|
|
23
15
|
const prop = new NEEDLE_progressive_texture_settings_property(this.document.getGraph(), "");
|
|
24
16
|
Object.assign(prop, ext);
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
if (textureMap.has(key)) {
|
|
28
|
-
// we keep a track of the index offset assuming gltf-transform textures order is the same as the texture definition order. This is by no means *not* bullet-proof but I'm not sure how to do it properly right now
|
|
29
|
-
// Perhaps we could try to find the texture with the same image source binary array as defined in the texture definition but this would also not be perfect I think...
|
|
30
|
-
// TODO: find a better way to handle texture definition count and texture count mismatch due to a texture being used in multiple slots (where gltf-transform optimizes the texture list and removes duplicates)
|
|
31
|
-
offset += 1;
|
|
32
|
-
// textureIndex = textureMap.get(key);
|
|
33
|
-
console.log(`INFO: Progressive texture extension was already found at index ${i}...`);
|
|
34
|
-
continue;
|
|
35
|
-
}
|
|
36
|
-
else {
|
|
37
|
-
textureMap.set(key, textureIndex);
|
|
38
|
-
}
|
|
39
|
-
const tex = textures[textureIndex];
|
|
40
|
-
if (tex)
|
|
41
|
-
tex.setExtension(EXTENSION_NAME, prop);
|
|
42
|
-
else {
|
|
43
|
-
// console.log(textureDefinitions)
|
|
44
|
-
console.warn(`WARN: Progressive texture at index ${i} was not found in the glTF file. This might result in falsely loaded textures for ${ext.guid} / name \"${texDef.name}\"`);
|
|
45
|
-
// if(debug)
|
|
46
|
-
// throw new Error(`Progressive texture at index ${i} was not found in the glTF file.`)
|
|
47
|
-
}
|
|
17
|
+
const texture = context.textures[texDef.source];
|
|
18
|
+
texture.setExtension(EXTENSION_NAME, prop);
|
|
48
19
|
}
|
|
49
20
|
}
|
|
50
21
|
return this;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "2.11.3
|
|
1
|
+
export declare const version = "2.11.3";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = "2.11.3
|
|
1
|
+
export const version = "2.11.3";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@needle-tools/gltf-build-pipeline",
|
|
3
|
-
"version": "2.11.3
|
|
3
|
+
"version": "2.11.3",
|
|
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",
|