From f9be7a946a4ededd59060e4df5c26cd42f298e0e Mon Sep 17 00:00:00 2001 From: Leon van Kammen Date: Tue, 14 Jan 2025 14:47:01 +0100 Subject: [PATCH] bugfix regarding aframe update --- src/3rd/js/aframe/index.js | 6 +++++- src/3rd/js/three/navigator.js | 2 ++ src/3rd/js/three/xrf/dynamic/filter.js | 2 ++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/3rd/js/aframe/index.js b/src/3rd/js/aframe/index.js index 15d67be..9f60a6b 100644 --- a/src/3rd/js/aframe/index.js +++ b/src/3rd/js/aframe/index.js @@ -7,7 +7,11 @@ window.AFRAME.registerComponent('xrf', { init: async function () { - this.data = this.attrValue ? Object.values(this.attrValue)[0] : "" + // fix needed since aframe 1.7.0 (non-key/value string values no longer accepted) + for( var i in this.data ){ + if( !this.data[i] ) delete this.data[i] + } + this.data = Object.keys(this.data)[0] + ":" + Object.values(this.data)[0] // override this.data when URL has passed (`://....com/?https://foo.com/index.glb` e.g.) if( typeof this.data == "string" ){ diff --git a/src/3rd/js/three/navigator.js b/src/3rd/js/three/navigator.js index bceb214..8b04151 100644 --- a/src/3rd/js/three/navigator.js +++ b/src/3rd/js/three/navigator.js @@ -18,7 +18,9 @@ xrf.navigator.to = (url,flags,loader,data) => { let URI if( typeof url == 'string' ){ + debugger URI = xrfragment.URI.toAbsolute( xrf.navigator.URI, url ) + debugger URI.hash = xrf.navigator.reactifyHash(URI.hash) // automatically reflect hash-changes to navigator.to(...) // decorate with extra state URI.fileChange = URI.file && URI.URN + URI.file != xrf.navigator.URI.URN + xrf.navigator.URI.file diff --git a/src/3rd/js/three/xrf/dynamic/filter.js b/src/3rd/js/three/xrf/dynamic/filter.js index 82c02ac..f945470 100644 --- a/src/3rd/js/three/xrf/dynamic/filter.js +++ b/src/3rd/js/three/xrf/dynamic/filter.js @@ -30,6 +30,8 @@ xrf.filter.scene = function(opts){ .sort(frag) // get (sorted) filters from XR Fragments .process(frag,scene,opts) // show/hide things + if( !scene ) return + scene.visible = true // always enable scene return scene