Skip to content

Commit a76dc41

Browse files
committed
fix: double Filament.init
1 parent c21170b commit a76dc41

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

js/sceneview.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,8 @@
238238
options = options || {};
239239
return new Promise(function(resolve, reject) {
240240
ensureFilament(function() {
241-
Filament.init([], function() {
241+
// If Filament WASM is already initialized (Engine exists), skip init
242+
function setup() {
242243
try {
243244
const canvas = typeof canvasOrId === 'string'
244245
? document.getElementById(canvasOrId)
@@ -299,7 +300,13 @@
299300
} catch (e) {
300301
reject(e);
301302
}
302-
});
303+
}
304+
// Check if Filament WASM is already ready
305+
if (Filament.Engine) {
306+
setup();
307+
} else {
308+
Filament.init([], setup);
309+
}
303310
});
304311
});
305312
}

0 commit comments

Comments
 (0)