aframevr / aframe-inspector

:mag: Visual inspector tool for A-Frame. Hit *<ctrl> + <alt> + i* on any A-Frame scene.
https://aframe.io/aframe-inspector/examples/
MIT License
654 stars 201 forks source link

shouldn't be looking for `<a-scene>` in DOM #472

Closed blairmacintyre closed 7 years ago

blairmacintyre commented 7 years ago

Rather, AFRAME now has a scenes property that contains a list of all attached scenes. The inspector should use this to find the scenes.

Doing this will also allow other kinds of scenes (such as a the <ar-scene> currently used by the argon-aframe bindings) to be inspected.

fernandojsg commented 7 years ago

I'm not sure what is actual use of scenes. Is it safe to change the a-scene querySelector with AFRAME.scenes ? /cc @ngokevin @dmarcos

ngokevin commented 7 years ago

yeah AFRAME.scenes[0]. i don't expect support for multiple scenes, i guess i made it an array to be flexible

fernandojsg commented 7 years ago

Thanks! Fixed :)

fernandojsg commented 7 years ago

Looking one of the points where I've replaced the document.querySelector('a-scene') with AFRAME.scenes[0] I guess if the scene is still not loaded it's not yet added to the list of available scenes: https://github.com/aframevr/aframe-inspector/blob/master/src/lib/inspector.js#L28

@ngokevin I guess I should just move that to the onSceneLoaded function itself right?

fernandojsg commented 7 years ago

I answer myself, it should be once the scene is loaded, as it will need the systems to be registered to query all the scenes around.

fernandojsg commented 7 years ago

As a proof of concept this is an scene already working with argon-aframe. Still needs some tweaks to work properly, but still something nice to have :) aframeargon

blairmacintyre commented 7 years ago

This is excellent, thanks!