Can you use the thumbnails?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By usurun

Is possible to get the thumbnails from the different files and use them as an texture? For example the scenes.

:bust_in_silhouette: Reply From: Grandro

As far as I know the thumbnails for the files are stored in %temp%/Godot (Directory for temporary files depending on your OS) in the format resthumb-{res_hash}.
The res_hash is defined in the import file of every resource.

If you read the import file of the resource you want and are able to navigate to the temp directory you would be able to load that file and use it as a texture. But navigating to the temporary folder could be a problem and is already a feature proposal:

Also I dont know when these thumbnails are being created, so the idea could turn out as unstable.

:bust_in_silhouette: Reply From: idbrii

Looks like get_editor_interface().make_mesh_previews() creates previews for editor code so you could use that to generate icons, save them, and then use them in game. You may need to search your scene’s node tree for a mesh if it’s not the top-most node.

I also found someone wrote code to do it at runtime, but I have no idea whether it works. GODOT 4: Render a scene to texture (for icon or 3D scene in UI) ($2323028) · Snippets · GitLab