From 92370b4548c728f2edbb02f80418efbf661495ba Mon Sep 17 00:00:00 2001 From: Leon van Kammen Date: Fri, 26 Jul 2024 11:56:07 +0000 Subject: [PATCH] bugfix: mark embedded scene as XRF to force cleanup during reset() --- src/3rd/js/three/xrf/src.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/3rd/js/three/xrf/src.js b/src/3rd/js/three/xrf/src.js index d8f60d1..c01fc98 100644 --- a/src/3rd/js/three/xrf/src.js +++ b/src/3rd/js/three/xrf/src.js @@ -52,6 +52,7 @@ xrf.frag.src.addModel = (model,url,frag,opts) => { } xrf.frag.src.enableSourcePortation({...opts, scene,mesh,url,model}) // flag everything isSRC & isXRF + mesh.isXRF = scene.isXRF = true mesh.traverse( (n) => { n.isSRC = n.isXRF = n[ opts.isLocal ? 'isSRCLocal' : 'isSRCExternal' ] = true }) xrf.emit('parseModel', {...opts, isSRC:true, mesh, model}) // this will execute all embedded metadata/fragments e.g. @@ -154,6 +155,9 @@ xrf.frag.src.scale = function(scene, opts, url){ new THREE.Box3().setFromObject(mesh).getSize(sizeTo) new THREE.Box3().setFromObject(cleanScene).getSize(sizeFrom) let ratio = sizeFrom.divide(sizeTo) + if( mesh.userData.src && mesh.userData.src.match(/other/) ){ + debugger + } scene.scale.multiplyScalar( 1.0 / Math.max(ratio.x, ratio.y, ratio.z)); }else{ // spec 4 of https://xrfragment.org/#src