BabylonJS / Babylon.js

Babylon.js is a powerful, beautiful, simple, and open game and rendering engine packed into a friendly JavaScript framework.
http://www.babylonjs.com
Apache License 2.0
23.06k stars 3.41k forks source link

Web service for exporting file formats to .babylon files #76

Closed gwenael-hagenmuller closed 10 years ago

gwenael-hagenmuller commented 10 years ago

I read in the roadmap that you plan to create a web service for exporting file formats to .babylon files. I'm really interesting in such a web service and I'ld like to know if you plan to export dae files to babylon files. I can help on it if needed. The web service would be great but actually a C# library would be even awesome for me (of course the lib would be used by the webservice). I would love to add to this C# library the functions to split a babylon file to several files to use incremental loading. By the way, it's such a wonderful feature. Thank you! If can I contribute to this, just let me know.

deltakosh commented 10 years ago

Hello :) The current FBX exporter should work with DAE (the code is here) The C# incremental splitter already exists and I can share the code with you if you want^^

deltakosh commented 10 years ago

Tadamm!!! Here is the MakeIncremental app: https://github.com/BabylonJS/Babylon.js/tree/master/Tools/MakeIncremental

gwenael-hagenmuller commented 10 years ago

Wonderful. I'll have a look to the exporter. And yes I would love you to share your code with me :)

gwenael-hagenmuller commented 10 years ago

Was too long to answer you. You have already shared the link before I hit "Comment"

gwenael-hagenmuller commented 10 years ago

I was looking to the code of the FBX Exporter and I saw that you import FBX thanks to XNA and then use XNA classes to write the Babylon file. Before that I was wondering how possible FBX exporter could export DAE; not really the same characters ;)

I modified your code to deal with .dae files. This part was easy since I only had to add ".dae" to FBXExporter::SupportedExtensions. Unfortunately I got the following error "Cannot autodetect which importer to use for ".dae". There are no importers which handle this file type. Specify the importer that handles this file type in your project." Indeed, I have Microsoft.Xna.Framework.Content.Pipeline.FBXImporter but not such dll for DAE. Do you know the "magic" dll I could use? Is there such a dll provided by the XNA framework?

If yes, FBX exporter could also work with DAE and even with any type of 3D files for which a XNA importer exists.

deltakosh commented 10 years ago

Could you try to rename your .dae to .fbx?

gwenael-hagenmuller commented 10 years ago

I admit that I would have loved it worked and to be part of a group of few priviliged people who know that FBXImporter, according to its name, doesn't only import FBX but also DAE... ;)

"Error code: 0 encountered when initializing FBX file loader. The file is either corrupted or it is not a valid FBX file."

I used 3ds Max 2013 to create a box and to export it with OpenCollada.

Meanwhile, I found a project on GitHub to import DAE to Xna and integrated it to your code. It does import correctly to Xna (except that it doesn't deal with up_axis and unity). A project sample loads correctly my DAE in a Xna game. I managed to export my DAE to BabylonJS format thanks to your Xna exporter but unfortunately the result is not what I was expected in BabylonJS; it's maybe the same error than here #106 so I'll give a try to the fix.

gwenael-hagenmuller commented 10 years ago

Tadamm! Thanks @professorf for your fix for #106. Now I'm able to export Collada to BabylonJS without having to use Blender so I will be able to have a webservice to do it for me :)

@deltakosh would you like me to do a pull-request for the exporter? Like I said I found on GitHub a DAE importer for XNA. I added it as a submodule in my fork but maybe you just want the dlls to be added not the whole repository. The importer has to be improved anymay (up_axis, unity...). The question is: should I contribute to it personally or should I have it as a submodule so anyone contributing to BabylonJS could contribute to it too?

Or maybe you know a better Collada importer for XNA.

deltakosh commented 10 years ago

Please contribute:) I will be really please to validate the push

professorf commented 10 years ago

Happy to help out @gwenael-hagenmuller! Thanks for the awesome product @deltakosh