ElHacker / GLTFUtility

Lightweight GLTF importer for Unity

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Discord GitHub issues GitHub license

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

2019-04-01_00-46-27 image image

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

  1. GLTFUtility requires Newtonsoft Json to be installed in your project.

    • Official upm package: "com.unity.nuget.newtonsoft-json": "2.0.0-preview",
    • Unofficial Asset Store: link
    • Unofficial git repo: link
  2. 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:

Features

  • 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

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);
}

About

Lightweight GLTF importer for Unity

License:MIT License


Languages

Language:C# 92.2%Language:ShaderLab 7.8%