Fixes: Model3D component loads forever when used as input and cache_examples=False (#1939)

* fix loading issue

* format
This commit is contained in:
Dawood Khan 2022-08-03 22:03:01 +01:00 committed by GitHub
parent ab18e07ff0
commit 0c2e5c8184
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 28 additions and 9 deletions

View File

@ -34,8 +34,8 @@
"@testing-library/svelte": "^3.1.0",
"@testing-library/user-event": "^13.5.0",
"autoprefixer": "^10.4.4",
"babylonjs": "^4.2.1",
"babylonjs-loaders": "^4.2.1",
"babylonjs": "^5.17.1",
"babylonjs-loaders": "^5.17.1",
"happy-dom": "^2.49.0",
"node-html-parser": "^5.3.3",
"npm-run-all": "^4.1.5",

View File

@ -33,8 +33,9 @@
}
async function handle_clear() {
if (scene) {
if (scene && engine) {
scene.dispose();
engine.dispose();
}
value = null;
await tick();
@ -59,9 +60,11 @@
let engine: BABYLON.Engine;
function addNewModel() {
if (scene) {
if (scene && engine) {
scene.dispose();
engine.dispose();
}
engine = new BABYLON.Engine(canvas, true);
scene = new BABYLON.Scene(engine);
scene.createDefaultCameraOrLight();
@ -87,8 +90,8 @@
}
BABYLON.SceneLoader.Append(
"",
url,
"",
scene,
() => {
scene.createDefaultCamera(true, true, true);

24
ui/pnpm-lock.yaml generated
View File

@ -13,8 +13,8 @@ importers:
'@testing-library/user-event': ^13.5.0
'@types/three': ^0.138.0
autoprefixer: ^10.4.4
babylonjs: ^4.2.1
babylonjs-loaders: ^4.2.1
babylonjs: ^5.17.1
babylonjs-loaders: ^5.17.1
happy-dom: ^2.49.0
node-html-parser: ^5.3.3
npm-run-all: ^4.1.5
@ -45,8 +45,8 @@ importers:
'@testing-library/svelte': 3.1.0_svelte@3.49.0
'@testing-library/user-event': 13.5.0_gzufz4q333be4gqfrvipwvqt6a
autoprefixer: 10.4.4_postcss@8.4.6
babylonjs: 4.2.2
babylonjs-loaders: 4.2.2
babylonjs: 5.17.1
babylonjs-loaders: 5.17.1
happy-dom: 2.49.0
node-html-parser: 5.3.3
npm-run-all: 4.1.5
@ -987,6 +987,10 @@ packages:
resolution: {integrity: sha512-LCQgW1lM+EpKK4yWMiPEgi6ONwJ7W4JrSu3t9JixNRgvnic72OnN2f0bt91rE30EJr1ZaokvkXD/aEiBp/Juyg==}
dev: false
/babylonjs-gltf2interface/5.17.1:
resolution: {integrity: sha512-QVT+jSVd/8zCiXojd4X3j9USGErrrd6oiB6PWOvnX/o2WSjrHvyEfIvgXHMNLoai8kTXv+qg3N1wwF6JMOovIA==}
dev: false
/babylonjs-loaders/4.2.2:
resolution: {integrity: sha512-IuShR5N4zkDMzKEGsCZ0uZDCn07BLLj8LlKwyiSwFR1V9KxAALkt2INTMCdXjuWELTcZEALZlyO85mKJ2pDPHw==}
dependencies:
@ -994,10 +998,22 @@ packages:
babylonjs-gltf2interface: 4.2.2
dev: false
/babylonjs-loaders/5.17.1:
resolution: {integrity: sha512-GnHoOPpkShJHbs5CiDEoG94+WcCNC1xIQ6OduSxEl4vKU1gjJ2iimCjG6nSzbzfqFHSuwWbAZTWI5UyNrxJFNQ==}
dependencies:
babylonjs: 5.17.1
babylonjs-gltf2interface: 5.17.1
dev: false
/babylonjs/4.2.2:
resolution: {integrity: sha512-p7mTi6+nLuWJTLbwxEJxLOh/QMHMV2KA0bviEoQSK5VtsAq1F0JghoOZYRs4aEqAZF/deFPWvMQk1vbXJ+4eEA==}
dev: false
/babylonjs/5.17.1:
resolution: {integrity: sha512-YzzIeR/dHKnAlax1ftq++61l2d1WuzDFnVlhUjmKtTdEcDQwHhsBVb9O4+D9PTXhW2iMclEFPEwwOYRv4UmCFA==}
requiresBuild: true
dev: false
/balanced-match/1.0.2:
resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==}