Can I save the texture from a ScreenCapture2D component to file?

I have an actor that I can move around in my scene. This actor has a camera component (so I can switch between the view of my character and the view of the camera on my actor) and a ScreenCaptureComponent2D (so I can have the view of the camera seen as picture-in-picture in my character’s view).

I’d like to be able to press a key and save a screenshot (as an image) from the view seen by the camera on my actor. I know that I can use “Set View Target with Blend” to change the point of view, use the console to take the screenshot, and use “Set View Target with Blend” again to go back to my character’s view.

The problem: the image I obtain is sometimes blurry or the screenshot is from the character’s view. My guess is everything happen fast and the change of camera is occuring during the screenshot. I can make it work if I add Delays before and after the console. But then it became really apparent that the view is changing and I’d like the process to be as smoothless as possible.

A better way to do it (in my opinion) would be to use the texture target of the ScreenCaptureComponent2D. After all, the image I want is already being stored each frame in a texture. I would need to simply save this texture as a file on disk. I wouldn’t need to switch camera (that does not make much sense since I already have the data I want). But I could not find how to do this in Blueprint.

Question 1: is it possible to store on file the content of my texture target using Blueprint? If not, is it doable in C++? I could write some C++ code and make the method accessible to Blueprints.

Question 2: if the answer to question 1 is no, is there any way to improve on the method I describe above? Or another method maybe?

Thanks!

Did you ever find an answer to this problem?

Sadly, no… I used delays around the console call doing my screenshot. Far from ideal but I haven’t found better.