Skip to content

Plattar/gltf-exporter

Repository files navigation

Twitter: @plattarglobal License

GLTF Exporter is a Unity3D Editor Tool that allows exporting Unity3D objects to glTF 2.0 format.


Before Usage 

Ensure to remove all converters that depend on the UnityGLTF. This is to ensure there are no script clashes or compatibility issues.

This tool has been tested using the latest Unity3D 2019.x release.

Exporter Usage

Grab the latest Unity3D Package release from the releases section and import it into a new or current project.

Once the GLTF Exporter tool has been imported you will see a new Toolbar in Unity3D.

Unity3D Toolbar

Clicking on Plattar->GLTF Exporter Toolbar will present the following editor wizard.

Unity3D Wizard

Either select or drag and drop a GameObject into the Export Object field.

Unity3D Export

Click on Export GLTF button.

You will be asked for a destination to export the GLTF files. The exporter will automatically zip all files and textures.

Texture Options

This section provides some flexibility regarding texture exports.

  • Select None for default functionality
  • Select JPG to force all textures to be exported in the JPG format
  • Select PNG to force all textures to be exported in the PNG format

The Texture Quality slider can be used to control the quality of the output textures. Higher value will increase the quality but have larger file sizes. This setting only applies to JPG textures.

Bounds Options

This section provides some flexibility regarding bounds exports.

  • Selecting None will skip writing the min/max fields in GLTF. Some renderers will be forced to re-calculate these fields during runtime, others will break. Use at own risk.
  • Selecting Local is the default functionality and will export min/max fields computed according to the current mesh pivot.
  • Selecting World will export min/max fields and force a center pivot for the local mesh.

Other Notes

Supported Unity objects and features so far:

  • Scene objects such as transforms and meshes
  • PBR materials (both Standard and Standard (Specular setup) for metal/smoothness and specular/smoothness respectively). Other materials may also be exported but not with all their channels.
  • Solid and skinning animation (note that custom scripts or humanoid skeletal animation are not exported yet).

(Note that animation is still in beta)

Please note that camera, lights, custom scripts, shaders and post processes are not exported.

PBR Materials

GLTF 2.0 Core Specification includes metal/roughness PBR material declaration. Specular/glossiness workflow is also available but kept under an extension for now.

Important Notes

Please note that for now, output glTF files may not be 100% compliant with the current state of glTF 2.0.

This plugin is being updated with glTF file format. It's strongly recommended to use the latest version from the release section.

Acknowledgements

This tool relies on the following open source projects.