Needle Engine

Changes between version 3.16.5 and 3.17.0
Files changed (2) hide show
  1. src/engine/extensions/NEEDLE_lightmaps.ts +7 -2
  2. src/engine-components/NestedGltf.ts +1 -0
src/engine/extensions/NEEDLE_lightmaps.ts CHANGED
@@ -3,9 +3,10 @@
3
3
  import { GLTF, GLTFLoaderPlugin, GLTFParser } from "three/examples/jsm/loaders/GLTFLoader.js";
4
4
  import { SourceIdentifier } from "../engine_types.js";
5
5
  import { resolveReferences } from "./extension_utils.js";
6
- import { getParam, resolveUrl } from "../engine_utils.js";
6
+ import { getParam, PromiseAllWithErrors, resolveUrl } from "../engine_utils.js";
7
7
  import { EXRLoader } from "three/examples/jsm/loaders/EXRLoader.js";
8
8
  import { RGBELoader } from "three/examples/jsm/loaders/RGBELoader.js";
9
+ import { isDevEnvironment } from "../debug/debug.js";
9
10
 
10
11
  // the lightmap extension is aimed to also export export skyboxes and custom reflection maps
11
12
  // should we rename it?
@@ -89,7 +90,11 @@
89
90
  if (res) dependencies.push(res);
90
91
  }
91
92
  }
92
- await Promise.all(dependencies);
93
+ const results = await PromiseAllWithErrors(dependencies);
94
+ if (results?.anyFailed) {
95
+ if (isDevEnvironment())
96
+ console.error("Failed to load lightmap extension", results);
97
+ }
93
98
  res();
94
99
  });
95
100
  }
src/engine-components/NestedGltf.ts CHANGED
@@ -36,6 +36,7 @@
36
36
  const matrix = this.gameObject.matrix;
37
37
  if (debug) console.log("Load nested:", this.filePath?.uri ?? this.filePath, this.gameObject.position);
38
38
  const res = await this.filePath?.instantiate?.call(this.filePath, opts);
39
+ if(debug) console.log("Nested loaded:", this.filePath?.uri ?? this.filePath, res);
39
40
  if (res) {
40
41
  res.matrixAutoUpdate = false;
41
42
  res.matrix.identity();