TriLib – Tutorial: Importing a model from Unity editor

In this tutorial, we will cover the steps to load your model using TriLib Unity Editor.

TriLib will scan your “Assets” folder looking for files it can import, everytime a file is found, a prefab with the same name is created:


Note: For files that both Unity editor and TriLib can load (FBX files, for example), Unity native importer will be used.

To configure importing options, click on the original file under the Assets explorer.

Your asset inspector will have the following tabs:

  • General
    • Post Processor Options: Please refer to this link.
  • Meshes
    • Dont Load Meshes: Turn on this field to disable mesh loading.
    • Combine Meshes: Turn on this field to combine multiple meshes with the same material into a single instance.
    • Scale: Use this field to override object scale.
    • Rotation Angles: Use this field to override object rotation angles.
    • Use 32 Bits Index Format: Turn on this field to enable 32-bits meshes index format (for loading high vertex-count models).
    • Generate Mesh Colliders: Turn on this field to enable mesh collider generation (only valid for skinned meshes).
    • Convex Mesh Colliders: Turn on this field to indicate that generated mesh colliders will be convex.
  • Materials
    • Dont Load Materials: Turn on this field to disable animations loading.
    • Apply Alpha Materials: Turn on this field to force alpha material scanning when you’re not using TriLib builtin image loader (STB Image Library).
    • Disable Alpha Materials: Turn on this field to don’t use alpha materials.
    • Use Cutout Materials: Turn on this field to use cutout alpha materials.
    • Use Standard Specular Material: Use this field to use Unity Standard Specular Material, if you get wrong specular results with the Standard Specular material, uncheck this field.
    • Texture Compression: Use this field to assign the loaded textures compression level.
    • Generate Mip Maps: Turn on this field to generate loaded textures mip-maps.
  • Animations
    • Dont Load Animations: Turn on this field to disable animations loading.
    • Auto Play Animations: Turn on this field to automatically play the first loaded animation (only for legacy animations).
    • Animation Wrap Mode: Use this field to change default animations wrap mode.
    • Ensure Quaternion Continuity: Turn on this field to realign quaternion keys to ensure shortest interpolation paths.
    • Use Legacy Animations: Turn on this field to use legacy Unity Animation component.
    • Animator Controller: If you don´t wish to use legacy animations, use this field to specify a Unity Animation Controller.
  • Misc
    • Add Asset Unloader: Turn on this field to add the AssetUnloader class to your loaded object, which releases resources upon the GameObject destruction.
    • Dont Load Cameras: Turn on this field to disable cameras loading.
    • Dont Load Lights: Turn on this field to disable cameras loading.
  • Metadata
    • Dont Load Metadata: Turn on this field to disable metadata loading.
  • Advanced
    • This tab contains various format specific configurations. You can hover the mouse over the configuration names to get more information about them.

If your options are okay, you can simply drag your created prefab to the scene, or instantiate it via code later.