Hey, I have a use case in which there are three model formats (GLB, OBJ, FBX).
A user can convert any format into the other two, and download it.
Is there any SDK/APIs for this ?
Hey, I have a use case in which there are three model formats (GLB, OBJ, FBX).
A user can convert any format into the other two, and download it.
Is there any SDK/APIs for this ?
three.js
can import all three formats although the support for FBX is a bit limited. Once loaded you can export to glTF and OBJ via GLTFExporter
and OBJExporter
however there is no FBXExporter
. Supporting FBX is tricky since the format is complex and there is no real specification.
I’m not aware of a single tool that can do what you are looking for. However, there are projects for single conversion tasks like converting OBJ to glTF (GitHub - CesiumGS/obj2gltf: Convert OBJ assets to glTF) or FBX to glTF (GitHub - facebookincubator/FBX2glTF: A command-line tool for the conversion of 3D model assets on the FBX file format to the glTF file format.).
@Mugen87
So let’s say that I have a FBX model rendered on the Scene
. Now, how can I “export” it somehow such that it is available for downloading as FBX file locally?
In this case I would say no conversion is required since you can offer the same FBX file for downloading, no?
Actually no. Thing is I am rendering the FBX, and then user can remove/add some meshes
in it.
Now the updated FBX should be available for downloading.
With GLB, there is no issue. But I have to give the support for FBX as well.
Any possible ways?
I’m sorry to interfere in your interesting conversation, but once a FBX file is loaded, it is digested into Three.js structures … and that Three.js structures are updated by the user.
Edit: What I mean is that there is no updated FBX file, but only Three.js structures. An imaginary FBXExporter would convert the internal Three.js format into FBX file, but as @Mugen87 said, such exporter does not exist for the time being. So, the option is to export into another format and use external tool to convert to FBX. Maybe there are such tools, I found this one link, but I’m not sure whether it works well. Oh, and there is another option too – you can contibute to Three.js by making an FBSExporter.
@PavelBoytchev
Correct, that’s the flow