Possible to publish your internal converter?

Hi,

I really like your online converter!

Right now I’d like to programmatically call an existing COLLADA (.dae) to GLTF (.glb) utility so that the output .glb can be parsed/loaded by the GLTFLoader. Is it possible to publish your converter as a command line tool, so that developers can download and use it in their program?

Thank you,

-Kun

What converter are you referring to? Do you mean the editor?

Sorry I was not clear. It seems like the editor can load a .dae file into a ThreeJS scene and then export the result to a .glb file.

What I need is a converter/utility that can directly convert a .dae file to a .glb file. Then I want to load the .glb file to my ThreeJS scene using the GLTFLoader.

Thanks,

-Kun

three.js does not provide something like this. Consider to use the following tool:

Yes that’s the one I am trying but facing issues. I thought you had a similar one. Thanks anyway!

Hi Michael,

After a .dae model is imported into the editor (https://threejs.org/editor/), I can export it to a .glb file using the “Export GLB” menu. How is that export function implemented? Could you please share some sample code to export a loaded model to GLB?

Thanks,

-Kun

If you go to the help menu, you’ll find a link you the source code of the editor.

The editor should be open source as is everything in the repo?

1 Like

The editor is loading a file using THREE.ColladaLoader and then exporting it using THREE.GLTFExporter. Those are not currently set up as a standalone CLI converter. It would be possible to do so (similar to https://github.com/mrdoob/three.js/pull/15552), but handling textures correctly in a Node.js context can be difficult.

If COLLADA2GLTF isn’t working as intended, I’d suggest filing a bug first – it may be an easy fix there.

Thanks everyone for your answers/comments! I really appreciate it!