Navigation
API > API/Runtime > API/Runtime/Engine
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.
| Name | ULevelStreaming |
| Type | class |
| Header File | /Engine/Source/Runtime/Engine/Classes/Engine/LevelStreaming.h |
| Include Path | #include "Engine/LevelStreaming.h" |
Syntax
UCLASS (Abstract, EditInlineNew, BlueprintType, Within=World, MinimalAPI)
class ULevelStreaming : public UObject
Inheritance Hierarchy
- UObjectBase → UObjectBaseUtility → UObject → ULevelStreaming
Derived Classes
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
ULevelStreaming
(
const FObjectInitializer& ObjectInitializer |
Engine/LevelStreaming.h |
Structs
| Name | Remarks |
|---|---|
| FLevelAnnotation | Annotation for fast inverse lookup. |
| FPackageNameMatcher | Matcher for searching streaming levels by PackageName |
Enums
Public
| Name | Remarks |
|---|---|
| EReqLevelBlock |
Constants
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| LevelAnnotations | FUObjectAnnotationSparse< FLevelAnnotation, false > | Engine/LevelStreaming.h |
Variables
Public
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| pad0 | ECurrentState | Engine/LevelStreaming.h | ||
| bClientOnlyVisible | bool | Applied to LoadedLevel | Engine/LevelStreaming.h | |
| bDisableDistanceStreaming | uint8 | 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) | Engine/LevelStreaming.h |
|
| bDrawOnLevelStatusMap | uint8 | If true, will be drawn on the 'level streaming status' map (STAT LEVELMAP console command) | Engine/LevelStreaming.h |
|
| bGarbageCollectionClusteringEnabled | uint8 | If true, allows garbage collection clustering for the level. | Engine/LevelStreaming.h | |
| bIsStatic | uint8 | Whether this level only contains static actors that aren't affected by gameplay or replication. | Engine/LevelStreaming.h |
|
| bLocked | uint8 | Whether this level is locked; that is, its actors are read-only. | Engine/LevelStreaming.h | |
| bShouldBlockOnLoad | uint8 | Whether we want to force a blocking load | Engine/LevelStreaming.h |
|
| bShouldBlockOnUnload | uint8 | Whether we want to force a blocking unload | Engine/LevelStreaming.h |
|
| EditorPathOwner | TWeakObjectPtr< UObject > | Applied to LoadedLevel | Engine/LevelStreaming.h |
|
| EditorStreamingVolumes | TArray< TObjectPtr< ALevelStreamingVolume > > | The level streaming volumes bound to this level. | Engine/LevelStreaming.h |
|
| FailedToLoad | ECurrentState | Engine/LevelStreaming.h | ||
| Keywords | TArray< FString > | List of keywords to filter on in the level browser | Engine/LevelStreaming.h | |
| LastVolumeUnloadRequestTime | float | Time of last volume unload request. Used in preventing spurious unload requests. | Engine/LevelStreaming.h | |
| LevelColor | FLinearColor | The level color used for visualization. (Show -> Advanced -> Level Coloration) | Engine/LevelStreaming.h |
|
| LevelTransform | FTransform | Transform applied to actors after loading. | Engine/LevelStreaming.h |
|
| LoadedNotVisible | ECurrentState | Engine/LevelStreaming.h | ||
| LoadedVisible | ECurrentState | Engine/LevelStreaming.h | ||
| Loading | ECurrentState | Engine/LevelStreaming.h | ||
| LODPackageNames | TArray< FName > | LOD versions of this level | Engine/LevelStreaming.h | |
| LODPackageNamesToLoad | TArray< FName > | LOD package names on disk | Engine/LevelStreaming.h | |
| MakingInvisible | ECurrentState | Engine/LevelStreaming.h | ||
| MakingVisible | ECurrentState | Engine/LevelStreaming.h | ||
| MinTimeBetweenVolumeUnloadRequests | float | Cooldown time in seconds between volume-based unload requests. | Engine/LevelStreaming.h |
|
| OnLevelHidden | FLevelStreamingVisibilityStatus | Called when level is no longer visible, may not be removed from world yet | Engine/LevelStreaming.h |
|
| OnLevelLoaded | FLevelStreamingLoadedStatus | Called when level is streamed in | Engine/LevelStreaming.h |
|
| OnLevelShown | FLevelStreamingVisibilityStatus | Called when level is added to the world and is visible | Engine/LevelStreaming.h |
|
| OnLevelUnloaded | FLevelStreamingLoadedStatus | Called when level is streamed out | Engine/LevelStreaming.h |
|
| PackageNameToLoad | FName | If this isn't Name_None, then we load from this package on disk to the new package named PackageName | Engine/LevelStreaming.h | |
| Unloaded | ECurrentState | Engine/LevelStreaming.h |
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| bHasCachedLoadedLevelPackageName | uint8 | Whether CachedLoadedLevelPackageName is valid | Engine/LevelStreaming.h | |
| bHasCachedWorldAssetPackageFName | uint8 | Whether CachedWorldAssetPackageFName is valid | Engine/LevelStreaming.h | |
| bIsRequestingUnloadAndRemoval | uint8 | Whether this level streaming object's level should be unloaded and the object be removed from the level list. | Engine/LevelStreaming.h | |
| bShouldBeVisible | uint8 | Whether the level should be visible if it is loaded | Engine/LevelStreaming.h |
|
| bShouldBeVisibleInEditor | uint8 | Whether this level should be visible in the Editor | Engine/LevelStreaming.h | |
| CachedLoadedLevelPackageName | FName | The cached package name of the currently loaded level. | Engine/LevelStreaming.h | |
| CachedWorldAssetPackageFName | FName | The cached package name of the world asset that is loaded by the levelstreaming | Engine/LevelStreaming.h | |
| CurrentState | ELevelStreamingState | What the current streamed state of the streaming level is | Engine/LevelStreaming.h | |
| CurrentStateLock | FTransactionallySafeRWLock | Used to get the CurrentState from an async task while it can be modified by the gamethread | Engine/LevelStreaming.h | |
| FolderPath | FName | The folder path for this level within the world browser. | Engine/LevelStreaming.h | |
| LevelLODIndex | int32 | Requested LOD. Non LOD sub-levels have Index = -1 | Engine/LevelStreaming.h |
|
| NetVisibilityState | FNetLevelVisibilityState | State for server handshake of NetLevelVisibilty requests | Engine/LevelStreaming.h | |
| StreamingPriorityOverrideBackup | TOptional< int32 > | Engine/LevelStreaming.h | ||
| TargetState | ELevelStreamingTargetState | What streamed state the streaming level is transitioning towards | Engine/LevelStreaming.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void AddLevelToCollectionAfterReload() |
Engine/LevelStreaming.h | ||
void BeginClientNetVisibilityRequest
(
bool bInShouldBeVisible |
Begin a client instigated NetVisibility request | Engine/LevelStreaming.h | |
virtual bool CanReplicateStreamingStatus() |
Returns whether level status can be replicated from the server to the client | Engine/LevelStreaming.h | |
void ClearLoadedLevel() |
Sets the LoadedLevel value to NULL | Engine/LevelStreaming.h | |
ULevelStreaming * CreateInstance
(
const FString& UniqueInstanceName |
Creates a new instance of this streaming level with a provided unique instance name | Engine/LevelStreaming.h |
|
const TArray< int32 > & GetAsyncRequestIDs () |
Returns the RequestIDs for the async load requests required to load the level. | Engine/LevelStreaming.h | |
PRAGMA_DISABLE_DEPRECATION_WARNINGS ECurrentState GetCurrentState() |
Returns the current loaded/visible state of the streaming level. | Engine/LevelStreaming.h | |
const FName & GetFolderPath() |
Get the folder path for this level for use in the world browser. Only available in editor builds | Engine/LevelStreaming.h | |
virtual TOptional< FFolder::FRootObject > GetFolderRootObject() |
Engine/LevelStreaming.h | ||
bool GetIsRequestingUnloadAndRemoval() |
Returns if the streaming level has requested to be unloaded and removed. | Engine/LevelStreaming.h |
|
int32 GetLevelLODIndex() |
Returns the world composition level LOD index. | Engine/LevelStreaming.h | |
ALevelScriptActor * GetLevelScriptActor() |
Returns the Level Script Actor of the level if the level is loaded and valid | Engine/LevelStreaming.h |
|
ELevelStreamingState GetLevelStreamingState() |
Engine/LevelStreaming.h | ||
EStreamingStatus GetLevelStreamingStatus() |
Used for debugging Level's status | Engine/LevelStreaming.h | |
ULevel * GetLoadedLevel() |
Gets a pointer to the LoadedLevel value | Engine/LevelStreaming.h |
|
int32 GetPriority () |
Sets the relative priority of considering the streaming level. | Engine/LevelStreaming.h | |
bool GetShouldBeVisibleFlag () |
Returns the value of bShouldBeVisible. | Engine/LevelStreaming.h | |
bool GetShouldBeVisibleInEditor() |
Returns if the streaming level should be visible in the editor. | Engine/LevelStreaming.h | |
FBox GetStreamingVolumeBounds() |
Get a bounding box around the streaming volumes associated with this LevelStreaming object | Engine/LevelStreaming.h | |
virtual UWorld * GetStreamingWorld() |
Returns the UWorld that triggered the streaming of this streaming level. | Engine/LevelStreaming.h | |
virtual UWorld * GetWorld() |
Engine/LevelStreaming.h | ||
const TSoftObjectPtr< UWorld > & GetWorldAsset() |
Returns a constant reference to the world asset this streaming level object references | Engine/LevelStreaming.h | |
virtual FName GetWorldAssetPackageFName() |
Gets the package name for the world asset referred to by this level streaming as an FName | Engine/LevelStreaming.h |
|
FString GetWorldAssetPackageName() |
Gets the package name for the world asset referred to by this level streaming | Engine/LevelStreaming.h | |
virtual const IWorldPartitionCell * GetWorldPartitionCell() |
Engine/LevelStreaming.h | ||
bool HasLoadedLevel() |
Returns whether the streaming level has loaded a level. | Engine/LevelStreaming.h | |
bool HasLoadRequestPending() |
Returns whether the streaming level is in the loading state. | Engine/LevelStreaming.h | |
bool IsLevelLoaded() |
Returns whether streaming level is loaded | Engine/LevelStreaming.h |
|
bool IsLevelVisible() |
Returns whether streaming level is visible | Engine/LevelStreaming.h |
|
bool IsStreamingStatePending() |
Returns whether level has streaming state change pending | Engine/LevelStreaming.h |
|
virtual bool IsUserManaged() |
Returns if the streaming level can be modified by user | Engine/LevelStreaming.h | |
bool IsValidStreamingLevel() |
Returns false if the level package associated to that streaming level is invalid. | Engine/LevelStreaming.h | |
bool IsWaitingForNetVisibilityTransactionAck
(
ENetLevelVisibilityRequest InRequestType |
Check if we are waiting for a making visible or invisible streaming transaction | Engine/LevelStreaming.h | |
void RemoveLevelFromCollectionForReload() |
After a sub level is reloaded in the editor the cache state needs to be refreshed. | Engine/LevelStreaming.h | |
void RemoveStreamingVolumeDuplicates() |
Remove duplicates in EditorStreamingVolumes list | Engine/LevelStreaming.h | |
void RenameForPIE
(
int PIEInstanceID, |
Rename package name to PIE appropriate name | Engine/LevelStreaming.h | |
void ResetPriorityOverride() |
Restore the original streaming level priority after a call to SetPriorityOverride(). | Engine/LevelStreaming.h | |
void SetFolderPath
(
const FName& InFolderPath |
Sets the folder path for this level in the world browser. Only available in editor builds | Engine/LevelStreaming.h | |
void SetIsRequestingUnloadAndRemoval
(
bool bInIsRequestingUnloadAndRemoval |
Sets if the streaming level should be unloaded and removed. | Engine/LevelStreaming.h |
|
void SetLevelLODIndex
(
int32 LODIndex |
Sets the world composition level LOD index and marks the streaming level as requiring consideration. | Engine/LevelStreaming.h |
|
void SetPriority
(
int32 NewPriority |
Sets the relative priority of considering the streaming level. | Engine/LevelStreaming.h |
|
void SetPriorityOverride
(
int32 PriorityOverride |
Provide a temporary priority override for the streaming level. | Engine/LevelStreaming.h | |
virtual void SetShouldBeLoaded
(
bool bInShouldBeLoaded |
Virtual that can be overridden to change whether a streaming level should be loaded. | Engine/LevelStreaming.h |
|
void SetShouldBeVisible
(
bool bInShouldBeVisible |
Sets the should be visible flag and marks the streaming level as requiring consideration. | Engine/LevelStreaming.h |
|
void SetShouldBeVisibleInEditor
(
bool bInShouldBeVisibleInEditor |
Sets if the streaming level should be visible in the editor. | Engine/LevelStreaming.h | |
virtual void SetWorldAsset
(
const TSoftObjectPtr< UWorld >& NewWorldAsset |
Setter for WorldAsset. | Engine/LevelStreaming.h | |
void SetWorldAssetByPackageName
(
FName InPackageName |
Sets the world asset based on the package name assuming it contains a world of the same name. | Engine/LevelStreaming.h | |
virtual bool ShouldBeAlwaysLoaded() |
Engine/LevelStreaming.h | ||
virtual bool ShouldBeLoaded () |
Return whether this level should be present in memory which in turn tells the streaming code to stream it in. | Engine/LevelStreaming.h |
|
virtual bool ShouldBeVisible() |
Return whether this level should be visible/ associated with the world if it is loaded. | Engine/LevelStreaming.h | |
virtual bool ShouldBlockOnUnload() |
Engine/LevelStreaming.h | ||
virtual bool ShouldRequireFullVisibilityToRender() |
Returns whether level should start to render only when it will be fully added to the world or not. | Engine/LevelStreaming.h | |
virtual bool ShowInLevelCollection() |
Returns if the streaming level is visible in LevelCollectionModel | Engine/LevelStreaming.h | |
void UpdateNetVisibilityTransactionState
(
bool bInShouldBeVisible, |
Set the current state of the current visibility/streaming transaction | Engine/LevelStreaming.h |
Overridden from UObject
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void PostEditChangeProperty
(
FPropertyChangedEvent& PropertyChangedEvent |
Engine/LevelStreaming.h | ||
virtual void PostEditUndo() |
Override Pre/PostEditUndo functions to handle editor transform | Engine/LevelStreaming.h | |
virtual void PostLoad() |
Engine/LevelStreaming.h | ||
virtual void Serialize
(
FArchive& Ar |
Engine/LevelStreaming.h |
Protected
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
bool CanMakeInvisible() |
Returns whether the streaming level can make invisible (can call RemoveFromWorld). | Engine/LevelStreaming.h | |
bool CanMakeVisible() |
Returns whether the streaming level can make visible (can call AddToWorld). | Engine/LevelStreaming.h | |
FName GetLoadedLevelPackageName() |
Engine/LevelStreaming.h | ||
virtual void OnCurrentStateChanged
(
ELevelStreamingState OldState, |
Called when the current state changes | Engine/LevelStreaming.h | |
virtual void OnLevelLoadedChanged
(
ULevel* Level |
Called by SetLoadedLevel | Engine/LevelStreaming.h | |
void OnLoadingFinished() |
Engine/LevelStreaming.h | ||
void OnLoadingStarted() |
Engine/LevelStreaming.h | ||
| Sets loaded level, fixups for PIE, notifies level is loaded, apply necessary modifications on level once loaded. | Engine/LevelStreaming.h | ||
virtual bool RequestLevel
(
UWorld* PersistentWorld, |
Try to find loaded level in memory, issue a loading request otherwise | Engine/LevelStreaming.h | |
virtual bool RequestVisibilityChange
(
bool bVisible |
Prepare the transition to the new state. | Engine/LevelStreaming.h | |
void SetCurrentState
(
ELevelStreamingState NewState |
Updates the current state of the streaming level and notifies any observers. | Engine/LevelStreaming.h | |
virtual void SetLoadedLevel
(
ULevel* Level |
Sets the value of LoadedLevel | Engine/LevelStreaming.h | |
bool ValidateUniqueWorldAsset
(
UWorld* PersistentWorld |
Called by RequestLevel to detect existing streaming level with same world asset | Engine/LevelStreaming.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static bool AllowIncrementalRemovalWhilePendingVisibility() |
Whether incremental removal of a streaming level can be done while there's a pending visible streaming level being processed. | Engine/LevelStreaming.h | |
| 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 | Engine/LevelStreaming.h | ||
| 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 | Engine/LevelStreaming.h | ||
| Utility that draws a legend of level streaming status | Engine/LevelStreaming.h | ||
static bool DefaultAllowClientUseMakingInvisibleTransactionRequests() |
Whether client should be using making invisible transaction requests to the server (default value). | Engine/LevelStreaming.h | |
static bool DefaultAllowClientUseMakingVisibleTransactionRequests() |
Whether client should be using making visible transaction requests to the server (default value). | Engine/LevelStreaming.h | |
static PRAGMA_DISABLE_DEPRECATION_WARNINGS const TCHAR * EnumToString
(
ECurrentState InCurrentState |
Engine/LevelStreaming.h | ||
static ULevelStreaming * FindStreamingLevel
(
const ULevel* Level |
Engine/LevelStreaming.h | ||
static FColor GetLevelStreamingStatusColor
(
EStreamingStatus Status |
Utility that gets a color for a particular level status | Engine/LevelStreaming.h | |
static const TCHAR * GetLevelStreamingStatusDisplayName
(
EStreamingStatus Status |
Utility that returns a string for a streaming level status | Engine/LevelStreaming.h | |
static void RemoveLevelAnnotation
(
const ULevel* Level |
Engine/LevelStreaming.h | ||
static bool ShouldReuseUnloadedButStillAroundLevels
(
const ULevel* InLevel |
If true level streaming can reuse an unloaded level that wasn't GC'd yet. | Engine/LevelStreaming.h | |
static bool ShouldServerUseMakingVisibleTransactionRequest() |
If true server will wait for client acknowledgment before making treating streaming levels as visible for the client | Engine/LevelStreaming.h |
Deprecated Variables
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| DrawColor_DEPRECATED | FColor | Deprecated level color used for visualization. | Engine/LevelStreaming.h | |
| PackageName_DEPRECATED | FName | Deprecated name of the package containing the level to load. | Engine/LevelStreaming.h |