Operating system or device - Godot version: Linux, Godot 3.0 (master)
Issue description:
Getting a screen capture from any viewport results in empty data.
Steps to reproduce:
get_viewport().queue_screen_capture()
yield(get_tree(),"idle_frame")
yield(get_tree(),"idle_frame")
var i = get_viewport().get_screen_capture()
i.save_png("user://cap.png")
Now queue_screen_capture() and get_screen_capture() don't even exist.
Haven't tryed from gdscript, but you should be able to call 'viewport.get_texture().get_data()' to get a reference to Image wich you can save. Also calling 'image.lock()' and image.unlock()' should let you get (and maybe set?) pixels.
This is how it works for color picker when picking a color from the screen:
https://github.com/godotengine/godot/blob/master/scene/gui/color_picker.cpp#L428
@MarianoGnu you are correct, the issue is only that ViewportTexture::get_data() is not bound to GDScript, but that should be easy to solve.
Most helpful comment
@MarianoGnu you are correct, the issue is only that ViewportTexture::get_data() is not bound to GDScript, but that should be easy to solve.