UKismetRenderingLibrary::ExportTexture2D
#include "Kismet/KismetRenderingLibrary.h"
Access: public
Specifiers: staticUFUNCTIONBlueprintCallable
Description
Writes a Texture2D to disk as an HDR image file.
Caveats & Gotchas
- • Exports as an HDR file regardless of the FileName extension you pass — the format is fixed by the engine, not by the file name.
- • Requires the texture's source or platform data to be accessible on the CPU; textures that have had their source data stripped (common in cooked builds) will fail silently or export garbage.
- • This writes to disk, so it is normally gated to editor/development tooling — do not expose it to untrusted Blueprint input in a shipping game since FilePath is not sanitized against directory traversal.
Signature
static void ExportTexture2D(UObject* WorldContextObject, UTexture2D* Texture, const FString& FilePath, const FString& FileName) Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| WorldContextObject | UObject* | World context used to resolve the current world. | — |
| Texture | UTexture2D* | The texture to export. | — |
| FilePath | const FString& | Directory to write the exported file into. | — |
| FileName | const FString& | File name (including extension) for the exported image. | — |
Return Type
void Example
Export a texture to disk C++
UKismetRenderingLibrary::ExportTexture2D(this, MyTexture, TEXT("C:/Temp"), TEXT("Exported.hdr")); Tags
Version History
Introduced in: unknown
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?