Godot Version
4.2
Question
I’m making a plugin to package maps for my game and I want to be able to capture a screenshot of the editor’s camera like this
but without the gismos in the top corners. Is this possible through gdscript?
4.2
I’m making a plugin to package maps for my game and I want to be able to capture a screenshot of the editor’s camera like this
Sure, get the viewport with EditorInterface.get_editor_viewport_3d()
and save its image like:
@tool
extends EditorScript
func _run() -> void:
var viewport = EditorInterface.get_editor_viewport_3d(0)
var img = viewport.get_texture().get_image()
img.save_png('res://preview.png')
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.