So I'm trying to do what's suggested here and here:
Now, I don't know if I just don't understand what they're saying to do, but I'm getting a blank image with my code below. (To summarize, I am just duplicating the parent node of the composite image I want to save and chucking that in an otherwise empty Viewport node. I get the
viewport nodes much earlier in the code.)
var j = image_node.duplicate()
var img = viewport.get_texture().get_data()
var buf = img.save_png_to_buffer()
With the node structure:
I've also tried fully moving the node into the Viewport node in the script, not making a duplicate, and then moving it back when I was done, but I also got a blank image from this.
(I checked to see that if I add it as a child node manually, the preview in the GUI will show the composite image (and it does), but I'd prefer to not leave my image_node in the Viewport node if I can help it, since it would break a lot to move it.)
Am I just fundamentally misunderstanding the solutions in those other answers? Any help would be massively appreciated!