ULevelStreaming

Abstract base class of container object encapsulating data required for streaming and providing interface for when a level should be streamed in and out of memory.

Windows
MacOS
Linux

Inheritance Hierarchy

References

Module

Engine

Header

/Engine/Source/Runtime/Engine/Classes/Engine/LevelStreaming.h

Include

#include "Engine/LevelStreaming.h"

Syntax

class ULevelStreaming : public UObject

Remarks

Abstract base class of container object encapsulating data required for streaming and providing interface for when a level should be streamed in and out of memory.

Variables

Name Description

Public variable

uint8 : 1

 

bDisableDistanceStreaming

Whether this level streaming object should be ignored by world composition distance streaming, so streaming state can be controlled by other systems (ex: in blueprints)

Public variable

uint8 : 1

 

bDrawOnLevelStatusMap

If true, will be drawn on the 'level streaming status' map (STAT LEVELMAP console command)

Public variable

uint8 : 1

 

bIsStatic

Whether this level only contains static actors that aren't affected by gameplay or replication.

Public variable

uint8 : 1

 

bLocked

Whether this level is locked; that is, its actors are read-only.

Protected variable

uint8 : 1

 

bShouldBeLoaded

Whether the level should be loaded

Public variable

uint8 : 1

 

bShouldBlockOnLoad

Whether we want to force a blocking load

Public variable

uint8 : 1

 

bShouldBlockOnUnload

Whether we want to force a blocking unload

Public variable

TArray < ALevelS ...

 

EditorStreamingVolumes

The level streaming volumes bound to this level.

Public variable

TArray < FString ...

 

Keywords

List of keywords to filter on in the level browser

Public variable

float

 

LastVolumeUnloadRequestTime

Time of last volume unload request. Used in preventing spurious unload requests.

Public variable

FLinearColor

 

LevelColor

The level color used for visualization. (Show > Advanced > Level Coloration)

Public variable

FTransform

 

LevelTransform

Transform applied to actors after loading.

Public variable

TArray < FName >

 

LODPackageNames

LOD versions of this level

Public variable

TArray < FName >

 

LODPackageNamesToLoad

LOD package names on disk

Public variable

float

 

MinTimeBetweenVolumeUnloadRequests

Cooldown time in seconds between volume-based unload requests.

Public variable

FLevelStreaming ...

 

OnLevelHidden

Called when level is removed from the world

Public variable

FLevelStreaming ...

 

OnLevelLoaded

Called when level is streamed in

Public variable

FLevelStreaming ...

 

OnLevelShown

Called when level is added to the world

Public variable

FLevelStreaming ...

 

OnLevelUnloaded

Called when level is streamed out

Public variable

FName

 

PackageNameToLoad

If this isn't Name_None, then we load from this package on disk to the new package named PackageName

Constructors

Name Description

Public function

ULevelStreaming

(
    const FObjectInitializer & ObjectIn...
)

Functions

Name Description

Public function

void

 

AddLevelToCollectionAfterReload()

Public function Static

void

 

BroadcastLevelLoadedStatus

(
    UWorld * PersistentWorld,
    FName LevelPackageName,
    bool bLoaded
)

Traverses all streaming level objects in the persistent world and in all inner worlds and calls appropriate delegate for streaming objects that refer specified level

Public function Static

void

 

BroadcastLevelVisibleStatus

(
    UWorld * PersistentWorld,
    FName LevelPackageName,
    bool bVisible
)

Traverses all streaming level objects in the persistent world and in all inner worlds and calls appropriate delegate for streaming objects that refer specified level

Public function

void

 

ClearLoadedLevel()

Sets the LoadedLevel value to NULL

Public function

ULevelStream ...

 

CreateInstance

(
    const FString & UniqueInstanceName
)

Creates a new instance of this streaming level with a provided unique instance name

Public function Static

const TCHAR ...

 

EnumToString

(
    ECurrentState InCurrentState
)

Public function Const

ECurrentStat ...

 

GetCurrentState()

Returns the current loaded/visible state of the streaming level.

Public function Const

const FName ...

 

GetFolderPath()

Get the folder path for this level for use in the world browser. Only available in editor builds

Public function Const

bool

 

GetIsRequestingUnloadAndRemoval()

Returns if the streaming level has requested to be unloaded and removed.

Public function Const

int32

 

GetLevelLODIndex()

Returns the world composition level LOD index.

Public function

ALevelScript ...

 

GetLevelScriptActor()

Returns the Level Script Actor of the level if the level is loaded and valid

Public function Const

ULevel *

 

GetLoadedLevel()

Gets a pointer to the LoadedLevel value

Public function Const

int32

 

GetPriority()

Sets the relative priority of considering the streaming level.

Public function Const

bool

 

GetShouldBeVisibleFlag()

Returns the value of bShouldBeVisible.

Public function Const

bool

 

GetShouldBeVisibleInEditor()

Returns if the streaming level should be visible in the editor.

Public function

FBox

 

GetStreamingVolumeBounds()

Get a bounding box around the streaming volumes associated with this LevelStreaming object

Public function Virtual Const

UWorld *

 

GetWorld()

Public function Const

const TSoftO ...

 

GetWorldAsset()

Returns a constant reference to the world asset this streaming level object references

Public function Const

FName

 

GetWorldAssetPackageFName()

Gets the package name for the world asset referred to by this level streaming as an FName

Public function Const

FString

 

GetWorldAssetPackageName()

Gets the package name for the world asset referred to by this level streaming

Public function Const

bool

 

HasLoadedLevel()

Returns whether the streaming level has loaded a level.

Public function Const

bool

 

HasLoadRequestPending()

Returns whether the streaming level is in the loading state.

Public function Const

bool

 

IsLevelLoaded()

Returns whether streaming level is loaded

Public function Const

bool

 

IsLevelVisible()

Returns whether streaming level is visible

Public function Const

bool

 

IsStreamingStatePending()

Returns whether level has streaming state change pending

Public function Const

bool

 

IsValidStreamingLevel()

Returns false if the level package associated to that streaming level is invalid.

Public function

void

 

RemoveLevelFromCollectionForReload()

After a sub level is reloaded in the editor the cache state needs to be refreshed.

Public function

void

 

RemoveStreamingVolumeDuplicates()

Remove duplicates in EditorStreamingVolumes list

Public function

void

 

RenameForPIE

(
    int PIEInstanceID
)

Rename package name to PIE appropriate name

Public function

void

 

SetFolderPath

(
    const FName & InFolderPath
)

Sets the folder path for this level in the world browser. Only available in editor builds

Public function

void

 

SetIsRequestingUnloadAndRemoval

(
    bool bInIsRequestingUnloadAndRemova...
)

Sets if the streaming level should be unloaded and removed.

Public function

void

 

SetLevelLODIndex

(
    int32 LODIndex
)

Sets the world composition level LOD index and marks the streaming level as requiring consideration.

Public function

void

 

SetPriority

(
    int32 NewPriority
)

Sets the relative priority of considering the streaming level.

Public function Virtual

void

 

SetShouldBeLoaded

(
    bool bInShouldBeLoaded
)

Virtual that can be overriden to change whether a streaming level should be loaded.

Public function

void

 

SetShouldBeVisible

(
    bool bInShouldBeVisible
)

Sets the should be visible flag and marks the streaming level as requiring consideration.

Public function

void

 

SetShouldBeVisibleInEditor

(
    bool bInShouldBeVisibleInEditor
)

Sets if the streaming level should be visible in the editor.

Public function

void

 

SetWorldAsset

(
    const TSoftObjectPtr < UWorld >& Ne...
)

Setter for WorldAsset.

Public function

void

 

SetWorldAssetByPackageName

(
    FName InPackageName
)

Sets the world asset based on the package name assuming it contains a world of the same name.

Public function Virtual Const

bool

 

ShouldBeAlwaysLoaded()

Public function Virtual Const

bool

 

ShouldBeLoaded()

Return whether this level should be present in memory which in turn tells the streaming code to stream it in.

Public function Virtual Const

bool

 

ShouldBeVisible()

Return whether this level should be visible/ associated with the world if it is loaded.

Overridden from UObject

Name Description

Public function Virtual

void

 

PostEditChangeProperty

(
    FPropertyChangedEvent & PropertyCha...
)

Called when a property on this object has been modified externally

Public function Virtual

void

 

PostEditUndo()

Override Pre/PostEditUndo functions to handle editor transform

Public function Virtual

void

 

PostLoad()

Do any object-specific cleanup required immediately after loading an object.

Public function Virtual

void

 

Serialize

(
    FArchive & Ar
)

Handles reading, writing, and reference collecting using FArchive .

Classes

Name

Description

Public struct

FPackageNameMatcher

Matcher for searching streaming levels by PackageName

Enums

Deprecated Variables

Name Description

Public variable

FColor

 

DrawColor_DEPRECATED

Deprecated level color used for visualization.

Public variable

FName

 

PackageName_DEPRECATED

Deprecated name of the package containing the level to load.

Select Skin
Light
Dark

Welcome to the new Unreal Engine 4 Documentation site!

We're working on lots of new features including a feedback system so you can tell us how we are doing. It's not quite ready for use in the wild yet, so head over to the Documentation Feedback forum to tell us about this page or call out any issues you are encountering in the meantime.

We'll be sure to let you know when the new system is up and running.

Post Feedback