A BLEND
, COLLADA
, FBX
and OBJ
to GLTF2
converter using Blender and glTF Blender Exporter.
Based on the ideas of 2gltf2 by Norbert Nopper. I wasn't able to get their repo working on MacOS and it was missing installation instructions.
Please note that the current version is highly experimental. Do not use this in your production workflow as of now.
Run blender -b -P gltf-converter.py -- <input> <output>
. A .gltf
file and a .bin
file will be written.
Installation instructions can be found on glTF Blender Exporter Scripts.
Install Blender and drag to the Applications
folder. On install a binary should be written to /usr/local/bin/blender
that can be verified using which blender
.
Open Blender and see if it starts correctly. If you do these adjustments before opening Blender you will likely run into a verification hash issue that MacOS does on every install.
Copy io_scene_gltf2
from glTF Blender Exporter Addons.
Select Blender
and right click show package contents -> Contents -> Resources -> 2.79 -> scripts -> addons
.
Place io_scene_gltf2
in there. Open Blender -> File -> User preferences -> Add-ons tab -> Toggle on Import-Export: glTF 2.0 format > Save user settings > Refresh
.
You should now be able to export scenes as glTF from the dropdown menu File -> glTF 2.0 (.glb)
and glTF 2.0 (.gltf)
.
Remove the default cube
scene by following the instructions otherwise you will have an extra cube in your export.
To validate the exported .gltf
and .bin
, select both (include textures if your model has them) and drag and drop them into the glTF Viewer.
Released under the MIT licence, further details available in the included LICENCE
.