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

fixing the active camera on saving #440

Closed Utopiah closed 7 years ago

Utopiah commented 7 years ago

Currently the active camera is the editor yet, once saved, the editor is not opened hence showing a grey page without content (cf #433 ). This PR switches the active camera from editor camera to main camera.

dmarcos commented 7 years ago

Should we change the active camera to the scene one and back to the editor camera when saving? Maybe better than replace strings. I

fernandojsg commented 7 years ago

Yep, I agree with @dmarcos , I wouldn't rely on string replacements, for example let's say that the exporter will modify in a near future to camera: false adding an extra space, or what happens if we've more than one camera, this will activate all of them. It's better to switch the previous active camera in the scene, export and then go back to the editor's camera. Closing it, if you feel like to modify to fix in that way, we'll just reopen it! :)

Utopiah commented 7 years ago

Wouldn't that make a weird user experience to see a camera change as he/she saves?

dmarcos commented 7 years ago

if you change, save and change back the user won't perceive anything since everything will happen before the render loop

Utopiah commented 7 years ago

OK let me try that. It's the alternative I already had in mind but wasn't sure which one was "cleaner".

Utopiah commented 7 years ago

@fernandojsg what about

    INSPECTOR.close();
    var sceneName = getSceneName(document.querySelector('a-scene'));
    saveString(generateHtml(), sceneName);
    INSPECTOR.open();

instead?

Gives the expected outcome and I didn't notice any UX issue.