BabylonJS / Editor

Community managed visual editor for Babylon.js
http://editor.babylonjs.com/
813 stars 232 forks source link

New feature: Export to code #55

Closed rodrix385 closed 5 years ago

rodrix385 commented 6 years ago

Some of us work with very heavy models (each having about 50mb or more). If the whole scene is exported as .babylon, then Chrome crashes during the export since it cannot handle so much data.

If the scene is exported as gltf, then all the special code is lost.

My suggestion would be to add a new export option that does the following: a - Creates an HTML file with Babylon JS code (reflecting all the changes done in the editor. It could also be a zip file that contains the html/js files, or a simple html with dependencies online) b - Exports all models as gltf files, and textures, one by one. (multiple saves)

If (b) is too complicated, it would be nice to atleast have (a) and the developer can later place all gltf files and textures manually next to the html file.

I would really appreciate it if you could add this feature. Thanks so much!

julien-moreau commented 6 years ago

+1 ! You can already export these js files when you export the template. Adding ASAP a way to change the final scene format to choose « glb, gltf or Babylon » when you export your template :)

julien-moreau commented 6 years ago

Just added the option Will be deployed with update pretty soon :) Or you can pull the branch "v2" Will close once deployed Thanks for feedback !

rodrix385 commented 6 years ago

Unfortunately... it is not working when trying to export gltf format:

Uncaught Error: _ConvertPBRMaterial: Glossiness values not included in the reflectivity texture currently not supported

Uncaught Error: Unsupported material type: colorShader

I am trying to export the demo scene

julien-moreau commented 6 years ago

Yes I got this error in the previous bjs version Be sure to update all your bjs modules to the latest and it will work :) I’m deploying ASAP on editor.babylonjs.com/v2 Will tell you once done !

julien-moreau commented 6 years ago

Done ! Can you confirm that you can export your scene as glb or gltf ? :)

rodrix385 commented 6 years ago

Hi @julien-moreau ! So sorry for the late reply, I couldn't get back to this project as soon as I wanted.

YES! I can export the scene as gltf! Success :) There is still a warning on the console regarding the Color Shader which cannot be exported, but that it is not affected the export.

Thanks so much! I REALLY appreciate it! :) Will keep testing the app and let you know anything I find...

julien-moreau commented 5 years ago

Thanks for your answer! Happy that it works well :)

Don't hesitate to create issues when you have a problem :)