How to export a 360 HDR panorama scene screenshot via Blueprint?

I managed to create a 360 HDR screenshot manually, by:

  • Adding a SceneCaptureCube to the scene
  • Creating a CubeRenderTarget asset and binding it to the SceneCaptureCube
  • I set the CubeRenderTarget to “HDR” and compression mode to “HDR (RGB, no sRGB)”
  • Right clicking the CubeRenderTarget, selecting “Asset Actions” then “Export…” will successfully create an HDR file (and I can preview it for example with the “LizardQ Viewer”

But now I want to do the exporting itself from a Blueprint (since I want to automate it). I started by creating an “Editor Utility Widget”, so I can have a button in the UI which should trigger it.

In the blueprint, first I try to find the CubeRenderTarget, and it seems to work (based on the printed strings):

And then I try to trigger new capture (just to keep it up-to-date, but I tried without this as well, and the same result) and try to save it:

Note that the callback just prints the boolean result, and in my case it keeps printing “false” (and the file is not created).

Any idea what I’m doing wrong?

Also I noticed that the HDR file format is not supported here? (hence I tried EXR). Is there a way to have HDR file format support as well?

Silly me forgot to check the logs, which contained:

LogScript: Error: Script Msg: Invalid texture supplied.
LogScript: Error: Script call stack:
    EUB_C.ExecuteUbergraph_EUB
    EUB_C.BndEvt__EUB_Button_0_K2Node_ComponentBoundEvent_1_OnButtonClickedEvent__DelegateSignature

Now I found the relevant code in the source, and it seems this component works only with Texture2D not with TextureCube.

Is there any other way to save the cube texture as HDR file?

Looking further into the source code, it seems that the HDR export via the context menu feature is included only in the editor, and the “Export to Disk” BP node is available in the runtime as well (but with less functionality). So I guess I would need to create a C++ plugin which would use the same functionality as the editor (FImageUtils::ExportRenderTargetCubeAsHDR(TexRTCube, Ar)), and expose it to the BP.