UniGLTF
glTF 2.0 importer and exporter for Unity 5.6 or later
License
See also
Sample Models
Huge model required Unity2017.3 or later
- Mesh.IndexFormat(from 2017.3) is required
example. SciFiHelmet(70074vertices)
Download
Usage
Import as prefab
- drop gltf folder or glb file into Assets folder
or
- editor mode
- menu [UniGLTF] - [Import]
- open gltf file(gltf, glb, zip) from out of Asset Folder
Import in runTime
string path; // gltf, glb or zip(include gltf)
var context = gltfImporter.Load(path);
context.ShowMeshes();
GameObject root = context.Root;
Export from scene
- select target root GameObject in scene(GameObect must be empty root, because target become gltf's
/scene
. A scene includes nodes. - menu [UniGLTF] - [Export]
- support only glb format
Export in runTime
GameObject go; // export target
string path; // glb write path
var gltf = gltfExporter.Export(go);
var bytes = gltf.ToGlbBytes();
File.WriteAllBytes(path, bytes);
- support only glb format