UKismetRenderingLibrary::ConvertRenderTargetToTexture2DEditorOnly
#include "Kismet/KismetRenderingLibrary.h"
Access: public
Specifiers: staticUFUNCTIONBlueprintCallable
Description
Copies the current contents of a render target into an existing Texture2D asset, overwriting its pixel data. Only works in the editor.
Caveats & Gotchas
- • Unlike RenderTargetCreateStaticTexture2DEditorOnly, this requires an already-existing Texture2D asset to write into rather than creating a new one.
- • Editor-only: has no effect in a packaged/cooked build.
- • The destination Texture2D's dimensions and format are not automatically adjusted to match the render target — mismatches can produce incorrect or corrupted results.
Signature
static void ConvertRenderTargetToTexture2DEditorOnly(UObject* WorldContextObject, UTextureRenderTarget2D* RenderTarget, UTexture2D* Texture); Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| WorldContextObject | UObject* | Object used to resolve the current world. | — |
| RenderTarget | UTextureRenderTarget2D* | The source render target to copy from. | — |
| Texture | UTexture2D* | An existing Texture2D asset whose pixel data will be overwritten with the render target's contents. | — |
Return Type
void Example
Refresh an existing texture asset from a capture C++
#if WITH_EDITOR
UKismetRenderingLibrary::ConvertRenderTargetToTexture2DEditorOnly(this, CaptureRT, ExistingTextureAsset);
#endif Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?