GLTFUtility
Allows you to import and export glTF files during runtime and in editor. glTF is a new opensource 3d model transmission format which supports everything you’ll ever need from a format in Unity. Read more about glTF here
What makes GLTFUtility different?
Focusing on simplicity and ease of use, GLTFUtility aims to be an import-and-forget solution, keeping consistency with built-in functionality.
Installation
Using Unity Package Manager (Help)
"com.siccity.gltfutility": "https://github.com/siccity/gltfutility.git"
Using git
- Get Newtonsoft.JSON from one of these sources
- Official upm package:
"com.unity.nuget.newtonsoft-json": "2.0.0-preview"
, - Unofficial git repo: https://github.com/jilleJr/Newtonsoft.Json-for-Unity
- Official upm package:
- Clone GLTFUtility by itself or as a submodule
- Clone into your assets folder
git clone git@github.com:Siccity/GLTFUtility.git
- Add repo as submodule
git submodule add git@github.com:Siccity/GLTFUtility.git Assets/Submodules/GLTFUtility
- Clone into your assets folder
Manual download
- Get Newtonsoft.JSON from the asset store
- Download GLTFUtility-master.zip and extract to your project assets
Features
System
Spec
Extensions
Known issues
ArgumentNullException: Value cannot be null
in build but not in editor.- This is most likely due to shaders being stripped from the build. To fix this, add the GLTFUtility shaders to the Always Included Shaders list in Graphic Settings.
Runtime import API
// Single thread
using Siccity.GLTFUtility;
void ImportGLTF(string filepath) {
GameObject result = Importer.LoadFromFile(filepath);
}
// Multithreaded
using Siccity.GLTFUtility;
void ImportGLTFAsync(string filepath) {
Importer.ImportGLTFAsync(filepath, new ImportSettings(), OnFinishAsync);
}
void OnFinishAsync(GameObject result) {
Debug.Log("Finished importing " + result.name);
}