Is there a way to bake an image from a Scene?

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

I’d like to bake something like a preview of the tiles of the meshlibs, but with a bigger size (the previews from get_item_preview are 64x64). Do you guys know if this is possible?

(the previews from get_item_preview() are 64x64)

Note that the built-in previews are only available when running the project from the editor, not in an exported project. This is because they are only generated by the editor.

Therefore, you must generate your own previews to use them in an exported project.

Calinou | 2020-03-05 09:41

:bust_in_silhouette: Reply From: Zylann

You could do this with a Viewport. Give it the size you want. Put one tile under it, with a camera to choose a proper view angle and distance. Wait one frame for the viewport to render its contents (using the Update Once mode), and take a screenshot of the result (Image obtainable with get_texture().get_data()). Then swap the tile to another and repeat the cycle if needed, for every tile.