https://github.com/garyo/godot-export-gltf
Python script to export glTF scenes from Godot game engine
https://github.com/garyo/godot-export-gltf
Last synced: 9 months ago
JSON representation
Python script to export glTF scenes from Godot game engine
- Host: GitHub
- URL: https://github.com/garyo/godot-export-gltf
- Owner: garyo
- License: mit
- Created: 2018-05-01T21:46:59.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-05-01T21:57:43.000Z (about 8 years ago)
- Last Synced: 2025-09-12T06:55:58.726Z (10 months ago)
- Language: Python
- Size: 10.7 KB
- Stars: 4
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# godot-export-gltf
Python script to export [glTF 2.0][gltf] scenes from the [Godot] game engine
## To use:
You'll need [Godot] v3.0.2 or later, and [godot-python].
You'll also need a local numpy installation in your godot-python.
(This script assumes it's in the python/ subdir, but if not, edit the
line in the script.)
Once you have the godot-python pythonscript symlink in your project dir,
follow the instructions at https://github.com/touilleMan/godot-python
to autoload this script. Specifically, add this to your project.godot:
```
[autoload]
Export="*res://export_gltf.py"
[gdnative]
singletons=[ "res://pythonscript.gdnlib" ]
```
Then in your gdscript, call export like this:
```
Export.export_scene('/tmp/godot-scene/godot-scene.gltf', get_node('/root'))
```
## Documentation
What is handled:
* `PrimitiveMesh`, `ArrayMesh`
* cameras
* lights (using KHR_lights extension)
* index and non-index mode
* transforms, materials (simple PBR only), UVs, textures, per-vertex colors
* renormalizes all normals
* coalesces vertices with "close" normals and colors, converting to index form
## TO DO:
* `MultiMeshInstance`
* animations
* cache/dedup textures
* ambient lights
* hdr backgrounds (not in glTF yet)
## HARDER:
* shaders
[gltf]: https://www.khronos.org/gltf/
[Godot]: https://github.com/godotengine/godot
[godot-python]: https://github.com/touilleMan/godot-python