Santarh / UniGLTF

glTF 2.0 importer and exporter for Unity 5.6 or later

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

UniGLTF

glTF 2.0 importer and exporter for Unity 5.6 or later

duck animation

License

See also

Sample Models

Huge model required Unity2017.3 or later

example. SciFiHelmet(70074vertices)

SciFiHelmet

Download

Usage

Import as prefab

  • drop gltf folder or glb file into Assets folder

duck_prefab

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

About

glTF 2.0 importer and exporter for Unity 5.6 or later

License:MIT License


Languages

Language:C# 98.7%Language:ShaderLab 1.3%