Unity Thumbnail Generator

Unity Thumbnail Generator is a powerful custom tool designed specifically for the Unity game engine. It allows developers to generate custom thumbnails for their prefabs. You can control lighting, camera positioning, and virtually everything else in the scene used for thumbnail generation. For instance, you have the flexibility to adjust the thumbnail background color by simply tweaking the "Environment->Background Type" setting on the scene's Main Camera.

Unity Thumbanil Generator view in the Unity Editor

How it works

The script traverses through a project folder recursively, searching for prefabs. Once located, it instantiates each prefab in a designated scene, capturing a snapshot of the scene's camera output on a texture. This texture is then saved to the Thumbnails folder and used as a thumbnail for the corresponding prefab in the Project Window. An editor extension ensures that thumbnails and prefabs are seamlessly matched by looking for thumbnails in the Thumbnails folder, following the same tree structure as the Asset folder.

How to Use

  • Integration: Import the provided scripts into your Unity project. Make sure to keep CustomThumbnailRenderer.cs in the Editor folder, while the other scripts can reside anywhere, but not in the Editor folder.
  • Prefab Setup: Import the prefabs you wish to generate thumbnails for. Customize the scene according to your preferences, adjusting lighting, camera angles, and other settings as needed.
  • Thumbnail Generation: Play the scene to trigger thumbnail generation. The script will handle the rest, generating custom thumbnails for each prefab.

Head over to the GitHub Readme for more details on settings and important classes.

Results

See below an example of before (Unity default, left) and after (Custom thumbnail, right)

Before and After comparison

Thanks

Thanks to this blog post for the large majority of the generation code: https://undertheweathersoftware.com/automatic-thumbnail-image-generator-for-3d-objects-in-unity/

Thanks to this other blog post for explaining the general idea of how to draw customizations on the project window: https://sahildhanju.com/posts/unity-asset-thumbnail-icons/

Technologies

UnityC#

Links