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
Focusing on simplicity and ease of use, GLTFUtility aims to be an import-and-forget solution, keeping consistency with built-in functionality.
-
GLTFUtility requires Newtonsoft Json to be installed in your project.
-
Choose one of the following:
- Download .zip and extract to your project assets
- Download latest .unitypackage and unpack to your projects assets
- (git) Clone into your assets folder
git clone git@github.com:Siccity/GLTFUtility.git
- (git) Add repo as submodule
git submodule add git@github.com:Siccity/GLTFUtility.git Assets/Submodules/GLTFUtility
- (package) If using Unity 2018.3 or later, you can add a new entry to the manifest.json file in your Packages folder
"com.siccity.gltfutility": "https://github.com/siccity/gltfutility.git"
Manual
NOTICE This is a work in progress. Expect bugs. Current features can be tracked below:
- Editor import
- Editor export
- Runtime import API
- Runtime export API
- Static mesh (with submeshes)
- UVs (up to 8 channels)
- Normals
- Tangents
- Vertex colors
- Materials (metallic/specular, opaque/mask/blend)
- Textures (embedded/external)
- Remote textures (during async only)
- Rig
- Animations (multiple)
- Morph targets
- Cameras
- Lights
- Draco compression
- Multithreading
- GLTF format
- GLB format
// 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);
}