RealDocs

UKismetRenderingLibrary::RenderTargetCreateStaticTexture2DEditorOnly

function Engine Blueprint Since 4.0
#include "Kismet/KismetRenderingLibrary.h"
Access: public Specifiers: staticUFUNCTIONBlueprintCallable

Description

Creates a new static Texture2D asset from the current contents of a render target. Only works in the editor.

Caveats & Gotchas

  • Editor-only: calling this in a packaged/cooked build has no effect and does not produce a usable asset.
  • Displayed in Blueprint as "Render Target 2D Create Static Texture 2D Editor Only" (its BlueprintCallable DisplayName), not the C++ function name — search for that phrase when looking for it in the node picker.
  • Marked UnsafeDuringActorConstruction — do not call from a construction script.

Signature

static UTexture2D* RenderTargetCreateStaticTexture2DEditorOnly(UTextureRenderTarget2D* RenderTarget, FString Name = "Texture", enum TextureCompressionSettings CompressionSettings = TC_Default, enum TextureMipGenSettings MipSettings = TMGS_FromTextureGroup);

Parameters

Name Type Description Default
RenderTarget UTextureRenderTarget2D* The source render target to bake into a static texture asset.
Name FString Base name/path used when creating the new texture asset. "Texture"
CompressionSettings enum TextureCompressionSettings Compression settings applied to the resulting texture. TC_Default
MipSettings enum TextureMipGenSettings Mip generation settings applied to the resulting texture. TMGS_FromTextureGroup

Return Type

UTexture2D*

Example

Bake a captured render target into an asset C++
#if WITH_EDITOR
UTexture2D* BakedTexture = UKismetRenderingLibrary::RenderTargetCreateStaticTexture2DEditorOnly(CaptureRT, TEXT("/Game/Textures/T_Baked"));
#endif

Version History

Introduced in: 4.0

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.