Skip to content
/ UniGLTF Public
forked from ousttrue/UniGLTF

glTF 2.0 importer and exporter for Unity 5.6 or later

License

Notifications You must be signed in to change notification settings

hiroj/UniGLTF

 
 

Repository files navigation

UniGLTF

glTF 2.0 importer and exporter for Unity 5.6 or later

Improved material importer(UniGLTF-1.21) !

Import gltf from (DamagedHelmet)[https://github.com/KhronosGroup/glTF-Sample-Models/tree/master/2.0/DamagedHelmet]. Below is converted to unity standard shader.

standard shader

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 98.1%
  • ShaderLab 1.9%