UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FPreviewScene Class Reference

#include <PreviewScene.h>

+ Inheritance diagram for FPreviewScene:

Classes

struct  ConstructionValues
 

Public Member Functions

ENGINE_API FPreviewScene (ConstructionValues CVS=ConstructionValues())
 
virtual ENGINE_API ~FPreviewScene ()
 
virtual ENGINE_API void AddComponent (class UActorComponent *Component, const FTransform &LocalToWorld, bool bAttachToRoot=false)
 
virtual ENGINE_API void RemoveComponent (class UActorComponent *Component)
 
virtual ENGINE_API void AddReferencedObjects (FReferenceCollector &Collector) override
 
virtual ENGINE_API FString GetReferencerName () const override
 
UWorldGetWorld () const
 
FSceneInterfaceGetScene () const
 
bool IsInitialized () const
 
class ULineBatchComponentGetLineBatcher () const
 
ENGINE_API void ClearLineBatcher ()
 
ENGINE_API void UpdateCaptureContents ()
 
ENGINE_API FRotator GetLightDirection ()
 
ENGINE_API void SetLightDirection (const FRotator &InLightDir)
 
ENGINE_API void SetLightBrightness (float LightBrightness)
 
ENGINE_API void SetLightColor (const FColor &LightColor)
 
ENGINE_API void SetSkyBrightness (float SkyBrightness)
 
ENGINE_API void SetSkyCubemap (class UTextureCube *Cubemap)
 
virtual ENGINE_API FLinearColor GetBackgroundColor () const
 
ENGINE_API void LoadSettings (const TCHAR *Section)
 
ENGINE_API void SaveSettings (const TCHAR *Section)
 
- Public Member Functions inherited from FGCObject
 FGCObject ()
 
 FGCObject (const FGCObject &Other)
 
 FGCObject (FGCObject &&Other)
 
 FGCObject (EFlags Flags)
 
virtual ~FGCObject ()
 
FGCObjectoperator= (const FGCObject &)
 
FGCObjectoperator= (FGCObject &&)
 
COREUOBJECT_API void RegisterGCObject ()
 
COREUOBJECT_API void UnregisterGCObject ()
 
virtual bool GetReferencerPropertyName (UObject *Object, FString &OutPropertyName) const
 

Public Attributes

class UDirectionalLightComponentDirectionalLight = nullptr
 
class USkyLightComponentSkyLight = nullptr
 

Protected Attributes

TObjectPtr< class UWorldPreviewWorld = nullptr
 
class ULineBatchComponentLineBatcher = nullptr
 
bool bForceAllUsedMipsResident
 

Additional Inherited Members

- Public Types inherited from FGCObject
enum class  EFlags : uint32 { None = 0 , RegisterLater = 1 << 0 , AddStableNativeReferencesOnly = 1 << 1 }
 
- Static Public Member Functions inherited from FGCObject
static COREUOBJECT_API void StaticInit ()
 
- Static Public Attributes inherited from FGCObject
static COREUOBJECT_API UGCObjectReferencerGGCObjectReferencer = nullptr
 

Detailed Description

Encapsulates a simple scene setup for preview or thumbnail rendering.

Constructor & Destructor Documentation

◆ FPreviewScene()

FPreviewScene::FPreviewScene ( FPreviewScene::ConstructionValues  CVS = ConstructionValues())

◆ ~FPreviewScene()

FPreviewScene::~FPreviewScene ( )
virtual

Member Function Documentation

◆ AddComponent()

void FPreviewScene::AddComponent ( class UActorComponent Component,
const FTransform LocalToWorld,
bool  bAttachToRoot = false 
)
virtual

Adds a component to the preview scene. This attaches the component to the scene, and takes ownership of it.

◆ AddReferencedObjects()

void FPreviewScene::AddReferencedObjects ( FReferenceCollector Collector)
overridevirtual

Pure virtual that must be overloaded by the inheriting class. Use this method to serialize any UObjects contained that you wish to keep around.

Parameters
CollectorThe collector of referenced objects.

Implements FGCObject.

◆ ClearLineBatcher()

void FPreviewScene::ClearLineBatcher ( )

Clean out the line batcher each frame

◆ GetBackgroundColor()

FLinearColor FPreviewScene::GetBackgroundColor ( ) const
virtual

Get the background color we use by default

◆ GetLightDirection()

FRotator FPreviewScene::GetLightDirection ( )

Accessor for finding the current direction of the preview scene's DirectionalLight.

◆ GetLineBatcher()

class ULineBatchComponent * FPreviewScene::GetLineBatcher ( ) const
inline

Access to line drawing

◆ GetReferencerName()

FString FPreviewScene::GetReferencerName ( ) const
overridevirtual

Overload this method to report a name for your referencer

Implements FGCObject.

◆ GetScene()

FSceneInterface * FPreviewScene::GetScene ( ) const
inline

◆ GetWorld()

UWorld * FPreviewScene::GetWorld ( ) const
inline

◆ IsInitialized()

bool FPreviewScene::IsInitialized ( ) const
inline

◆ LoadSettings()

void FPreviewScene::LoadSettings ( const TCHAR Section)

Load/Save settings to the config, specifying the key

◆ RemoveComponent()

void FPreviewScene::RemoveComponent ( class UActorComponent Component)
virtual

Removes a component from the preview scene. This detaches the component from the scene, and returns ownership of it.

◆ SaveSettings()

void FPreviewScene::SaveSettings ( const TCHAR Section)

◆ SetLightBrightness()

void FPreviewScene::SetLightBrightness ( float  LightBrightness)

◆ SetLightColor()

void FPreviewScene::SetLightColor ( const FColor LightColor)

◆ SetLightDirection()

void FPreviewScene::SetLightDirection ( const FRotator InLightDir)

Function for modifying the current direction of the preview scene's DirectionalLight.

◆ SetSkyBrightness()

void FPreviewScene::SetSkyBrightness ( float  SkyBrightness)

◆ SetSkyCubemap()

void FPreviewScene::SetSkyCubemap ( class UTextureCube Cubemap)

◆ UpdateCaptureContents()

void FPreviewScene::UpdateCaptureContents ( )

Update sky and reflection captures

Member Data Documentation

◆ bForceAllUsedMipsResident

bool FPreviewScene::bForceAllUsedMipsResident
protected

This controls whether or not all mip levels of textures used by UMeshComponents added to this preview window should be loaded and remain loaded.

◆ DirectionalLight

class UDirectionalLightComponent* FPreviewScene::DirectionalLight = nullptr

◆ LineBatcher

class ULineBatchComponent* FPreviewScene::LineBatcher = nullptr
protected

◆ PreviewWorld

TObjectPtr<class UWorld> FPreviewScene::PreviewWorld = nullptr
protected

◆ SkyLight

class USkyLightComponent* FPreviewScene::SkyLight = nullptr

The documentation for this class was generated from the following files: