Closed Utopiah closed 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
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! :)
Wouldn't that make a weird user experience to see a camera change as he/she saves?
if you change, save and change back the user won't perceive anything since everything will happen before the render loop
OK let me try that. It's the alternative I already had in mind but wasn't sure which one was "cleaner".
@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.
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.