Confusion with scene-viewer. #4790
clochardM33
started this conversation in
General
Replies: 1 comment 1 reply
-
Q1: Yes. Scene-viewer's entire API is just a URL with some query params. It's a separate app, so has no access to the browser's memory. Hence why WebXR mode is faster. Q2: You can make a custom AR button and attach a click listener to that. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I've been going in circles with what seemed to be intermittent AR fails specific to scene-viewer.
Issue #4582 is where I was looking/commenting and the comment about texture size and resources was a big part of the headache.
My problem is that when using scene-viewer the switch to AR often, but not always, throws a "Can't load object" response.
Although the explanation for the root cause of this error is hiding in plain sight (i.e. It can't load the object Mr Coder!) it has taken a good long while to spot why it can't load it.
In most, but not all (and this is the cause of the intermittency) I have a scheme where the glb file is deleted off the server once model-viewer.onload is raised.
I can now see that when the go to AR request occurs there is a request to GET this glb from server.
Q1. Am I understanding this correctly? When scene-viewer AR starts it goes away and gets the model once again and does not get passed the in-memory glb that is gently spinning in model-viewer? This then means that if the glb file is not available this is a guaranteed fail?
(I know that was 3 ?s)
If I knew the AR request was coming I could put the glb file back in it's expected place on the server. Which leads onto Q2.
Q2. Is there a js route to bind an function to the AR button push that fires before scene-viewer starts?
I had a quick look at trying to attach to document.getElementById(''default-ar-button"), but this always returns null (presumably because it is below #shadow-root
(If you're wondering why the glb file is deleted it is to do with copywrite protection).
I would be grateful if anyone can add light to Q1 and or offer any hints for Q2.
Thanks.
Beta Was this translation helpful? Give feedback.
All reactions