ULevel

The level object.

Windows
MacOS
Linux

Inheritance Hierarchy

References

Module

Engine

Header

/Engine/Source/Runtime/Engine/Classes/Engine/Level.h

Include

#include "Engine/Level.h"

Syntax

class ULevel :
    public UObject,
    public IInterface_AssetUserData

Remarks

The level object. Contains the level's actor list, BSP information, and brush list. Every Level has a World as its Outer and can be used as the PersistentLevel, however, when a Level has been streamed in the OwningWorld represents the World that it is a part of. A Level is a collection of Actors (lights, volumes, mesh instances etc.). Multiple Levels can be loaded and unloaded into the World to create a streaming experience.

Variables

Name Description

Public variable

ULevelActorCont...

 

ActorCluster

Public variable

TArray< AActor ...

 

Actors

Array of all actors in this level, used by FActorIteratorBase and derived classes

Public variable

TArray< AActor ...

 

ActorsForGC

Array of actors to be exposed to GC in this level.

Protected variable

TArray< UAssetU...

 

AssetUserData

Array of user data stored with the asset

Public variable

uint8: 1

 

bActorClusterCreated

Whether the level had its actor cluster created.

Public variable

uint8: 1

 

bAlreadyAssociatedStreamableResources

Whether we already associated streamable resources.

Public variable

uint8: 1

 

bAlreadyClearedActorsSeamlessTravelFlag

Whether we already cleared [AActor::bActorSeamlessTraveled](API\Runtime\Engine\GameFramework\AActor\bActorSeamlessTraveled).

Public variable

uint8: 1

 

bAlreadyInitializedNetworkActors

Whether we already initialized network actors.

Public variable

uint8: 1

 

bAlreadyMovedActors

The below variables are used temporarily while making a level visible.

Public variable

uint8: 1

 

bAlreadyRoutedActorInitialize

Whether we already routed initialize on actors.

Public variable

uint8: 1

 

bAlreadyShiftedActors

Whether we already shift actors positions according to world composition.

Public variable

uint8: 1

 

bAlreadySortedActorList

Whether we already sorted the actor list.

Public variable

uint8: 1

 

bAlreadyUpdatedComponents

Whether we already updated components.

Public variable

uint8: 1

 

bAreComponentsCurrentlyRegistered

Whether components are currently registered or not.

Public variable

uint8: 1

 

bClientOnlyVisible

Whether this level is specific to client, visibility state will not be replicated to server

Public variable

uint8: 1

 

bContainsStableActorGUIDs

Whether the level has been saved after introducing actor GUIDs

Public variable

uint8: 1

 

bGeometryDirtyForLighting

Whether the geometry needs to be rebuilt for correct lighting

Public variable

uint8

 

bHasCurrentActorCalledPreRegister

Whether the actor referenced by CurrentActorIndexForUpdateComponents has called PreRegisterAllComponents

Public variable

uint8: 1

 

bHasRerunConstructionScripts

Whether this level has gone through a complete rerun construction script pass.

Public variable

uint8: 1

 

bIsAssociatingLevel

Whether this level is in the process of being associated with its world (i.e. we are within AddToWorld for this level

Public variable

uint8: 1

 

bIsBeingRemoved

Whether the level is currently being removed from the world

Public variable

uint8: 1

 

bIsDisassociatingLevel

Whether this level is in the process of being disassociated with its world (i.e. we are within RemoveFromWorld for this level

Public variable

uint8: 1

 

bIsLightingScenario

Whether the level is a lighting scenario.

Public variable

uint8: 1

 

bIsVisible

Whether the level is currently visible/ associated with the world

Public variable

bool

 

bLevelOkayForPlacementWhileCheckedIn

Public variable

uint8: 1

 

bLocked

Whether this level is locked; that is, its actors are read-only Used by WorldBrowser to lock a level when corresponding ULevelStreaming does not exist

Public variable

uint8: 1

 

bRequireFullVisibilityToRender

Whether this level should be fully added to the world before rendering his components

Public variable

uint8: 1

 

bStaticComponentsRegisteredInStreamingManager

Whether the level has finished registering all static components in the streaming manager.

Public variable

uint8: 1

 

bTextureStreamingRotationChanged

Whether a level transform rotation was applied since the texture streaming builds.

Public variable

uint8: 1

 

bWasDuplicated

Whether this level was duplicated

Public variable

uint8: 1

 

bWasDuplicatedForPIE

Whether this level was duplicated for PIE

Public variable

int32

 

CurrentActorIndexForUnregisterComponents

Current index into actors array for updating components.

Public variable

int32

 

CurrentActorIndexForUpdateComponents

Current index into actors array for updating components.

Public variable

int32

 

FixupOverrideVertexColorsCount

Public variable

float

 

FixupOverrideVertexColorsTime

Public variable

TWeakObjectPtr<...

 

InstancedFoliageActor

Cached pointer to Foliage actor

Public variable

TWeakObjectPtr<...

 

LevelBoundsActor

Actor which defines level logical bounding box

Public variable

FGuid

 

LevelBuildDataId

Identifies map build data specific to this level, eg lighting volume samples.

Public variable

FLinearColor

 

LevelColor

The level color used for visualization.

Public variable

ALevelScriptAct...

 

LevelScriptActor

The level scripting actor, created by instantiating the class from LevelScriptBlueprint.

Public variable

ULevelScriptBlu...

 

LevelScriptBlueprint

Reference to the blueprint for level scripting

Public variable

FLevelSimplific...

 

LevelSimplification

Level simplification settings for each LOD

Public variable

FIntVector

 

LightBuildLevelOffset

Level offset at time when lighting was built

Public variable

float

 

LightmapTotalSize

Total number of KB used for lightmap textures in the level.

Public variable

UMapBuildDataRe...

 

MapBuildData

Registry for data from the map build.

Public variable

UModel *

 

Model

BSP UModel.

Public variable

TArray< class U...

 

ModelComponents

BSP Model components used for rendering.

Public variable

TArray< UNaviga...

 

NavDataChunks

Navigation related data that can be stored per level

Public variable

ANavigationObje...

 

NavListEnd

Public variable

ANavigationObje...

 

NavListStart

Start and end of the navigation list for this level, used for quickly fixing up when streaming this level in/out.

Public variable

int32

 

NumTextureStreamingDirtyResources

Num of resources that have changed since the last texture streaming build. Updated in map check.

Public variable

int32

 

NumTextureStreamingUnbuiltComponents

Num of components missing valid texture streaming data. Updated in map check.

Public variable

FLevelTransform...

 

OnApplyLevelTransform

Public variable

FLevelCleanupEv...

 

OnCleanupLevel

Public variable

UWorld *

 

OwningWorld

The World that has this level in its Levels array.

Public variable

FPrecomputedLig...

 

PrecomputedLightVolume

The precomputed light information for this level.

Public variable

FPrecomputedVis...

 

PrecomputedVisibilityHandler

Contains precomputed visibility data for this level.

Public variable

FPrecomputedVol...

 

PrecomputedVolumeDistanceField

Precomputed volume distance field for this level.

Public variable

FPrecomputedVol...

 

PrecomputedVolumetricLightmap

The volumetric lightmap data for this level.

Public variable

FRenderCommandF...

 

RemoveFromSceneFence

Fence used to track when the rendering thread has finished referencing this ULevel's resources.

Public variable

float

 

ShadowmapTotalSize

Total number of KB used for shadowmap textures in the level.

Public variable

TArray< FVector...

 

StaticNavigableGeometry

Threes of triangle vertices - AABB filtering friendly.

Public variable

TArray< FGuid >

 

StreamingTextureGuids

The Guid of each texture refered by FStreamingTextureBuildInfo::TextureLevelIndex

Public variable

TArray< FGuid >

 

TextureStreamingResourceGuids

The Guid list of all materials and meshes Guid used in the last texture streaming build.

Public variable

FTickTaskLevel ...

 

TickTaskLevel

Data structures for holding the tick functions

Public variable

FURL

 

URL

URL associated with this level.

Constructors

Name Description

Public function

ULevel

(
    const FObjectInitializer& ObjectIn...
)

Public function

ULevel

(
    FVTableHelper& Helper
)

DO NOT USE. This constructor is for internal usage only for hot-reload purposes.

Destructors

Name Description

Public function

~ULevel()

Functions

Name Description

Public function Static

void

 

AddReferencedObjects

(
    UObject* InThis,
    FReferenceCollector& Collector
)

Public function

void

 

ApplyWorldOffset

(
    const FVector& InWorldOffset,
    bool bWorldShift
)

Shift level actors by specified offset The offset vector will get subtracted from all actors positions and corresponding data structures

Public function

void

 

BroadcastLevelBoundsActorUpdated()

Broadcasts that Level bounds actor has been updated

Public function Static

void

 

BuildStreamingData

(
    UWorld* World,
    ULevel* TargetLevel,
    UTexture2D* TargetTexture
)

Rebuilds static streaming data for all levels in the specified UWorld.

Public function Static

bool

 

CanConvertActorToExternalPackaging

(
    AActor* Actor
)

Public function

void

 

CleanupLevel()

Flag this level instance for destruction.

Public function

void

 

CleanupLevelScriptBlueprint()

Nulls certain references related to the LevelScriptBlueprint.

Public function

void

 

ClearActorsSeamlessTraveledFlag()

Public function

void

 

ClearLevelComponents()

Clears all components of actors associated with this level (aka in Actors array) and also the BSP model components.

Public function

void

 

CommitModelSurfaces()

Commits changes made to the UModel's surfaces.

Public function

void

 

ConvertAllActorsToPackaging

(
    bool bExternal
)

Convert this level actors to the specified loading strategy

Public function Static

UPackage ...

 

CreateActorPackage

(
    UPackage* InLevelPackage,
    const FGuid& InGuid
)

Create an package for this actor

Public function Const

UPackage ...

 

CreateMapBuildDataPackage()

Public function

void

 

CreateModelComponents()

Called to create ModelComponents for BSP rendering

Public function

void

 

CreateReplicatedDestructionInfo

(
    AActor*const Actor
)

Populate an entry for Actor in the DestroyedReplicatedStaticActors list

Public function

void

 

DetachAttachAllActorsPackages

(
    bool bReattach
)

Detach or reattach all level actors to from/to their external package

Public function

void

 

FixupForPIE

(
    int32 PIEInstanceID
)

Call on a level that was loaded from disk instead of PIE-duplicating, to fixup actor references

Public function Const

FLevelCollec...

 

GetCachedLevelCollection()

Returns the cached collection that contains this level, if any. May be null.

Public function Const

ABrush *

 

GetDefaultBrush()

Returns the default brush for this level.

Public function Const

const TArray...

 

GetDestroyedReplicatedStaticActors()

Public function Static

FString

 

GetExternalActorsPath

(
    UPackage* InLevelPackage,
    const FString& InPackageShortName
)

Get the folder containing the external actors for this level

Public function Static

FString

 

GetExternalActorsPath

(
    const FString& InLevelPackageName,
    const FString& InPackageShortName
)

Get the folder containing the external actors for this level path

Public function Const

TArray< clas...

 

GetLevelBlueprints()

Returns a list of all blueprints contained within the level

Public function

ILevelPartit...

 

GetLevelPartition()

Get the level partition assigned to this level, if any

Public function Const

const ILevel...

 

GetLevelPartition()

Get the level partition assigned to this level, if any

Public function Const

ALevelScript...

 

GetLevelScriptActor()

Returns the level scripting actor associated with this level

Public function

ULevelScript...

 

GetLevelScriptBlueprint

(
    bool bDontCreate
)

Grabs a reference to the level scripting blueprint for this level.

Public function Const

TArray< UPac...

 

GetLoadedExternalActorPackages()

Get the list of (loaded) external actor packages associated with this level

Public function Const

TArray< FStr...

 

GetOnDiskExternalActorPackages()

Get the list of (on disk) external actor packages associated with this level

Public function

UMapBuildDat...

 

GetOrCreateMapBuildData()

Public function Const

TArray< FVec...

 

GetStaticNavigableGeometry()

Public function Virtual Const

UWorld *

 

GetWorld()

Public function Const

AWorldSettin...

 

GetWorldSettings

(
    bool bChecked
)

Returns the world info for this level.

Public function

void

 

HandleLegacyMapBuildData()

Creates UMapBuildDataRegistry entries for legacy lightmaps from components loaded for this level.

Public function

bool

 

HasAnyActorsOfType

(
    UClass* SearchType
)

Utility searches this level's actor list for any actors of the specified type.

Public function Const

bool

 

HasVisibilityChangeRequestPending()

Whether the level is currently pending being made invisible or visible.

Public function

bool

 

IncrementalUnregisterComponents

(
    int32 NumComponentsToUnregister
)

Incrementally unregisters all components of actors associated with this level.

Public function

void

 

IncrementalUpdateComponents

(
    int32 NumComponentsToUpdate,
    bool bRerunConstructionScripts,
    FRegisterComponentContext* Con...
)

Incrementally updates all components of actors associated with this level.

Public function

void

 

Initialize

(
    const FURL& InURL
)

Constructor.

Public function

void

 

InitializeNetworkActors()

Handles network initialization for actors in this level

Public function

void

 

InitializeRenderingResources()

Initializes rendering resources for this level.

Public function

void

 

InvalidateModelGeometry()

Invalidates the cached data used to render the level's UModel.

Public function

void

 

InvalidateModelSurface()

Discards the cached data used to render the level's UModel.

Public function Const

bool

 

IsCurrentLevel()

Is this the current level in the world it is owned by

Public function Static

bool

 

IsNetActor

(
    const AActor* Actor
)

Used internally to determine which actors should go on the world's NetworkActor list.

Public function Const

bool

 

IsPartitionedLevel()

Returns true if the current level is a partitioned level

Public function Const

bool

 

IsPartitionSubLevel()

Returns true if the current level is a sublevel (managed by a parent partitioned level)

Public function Const

bool

 

IsPersistentLevel()

Is this the persistent level

Public function Const

bool

 

IsUsingExternalActors()

Returns true if the level uses external actors mode.

Public function

FLevelBounds...

 

LevelBoundsActorUpdated()

Public function

void

 

MarkLevelBoundsDirty()

Marks level bounds as dirty so they will be recalculated

Public function

void

 

MarkLevelComponentsRenderStateDirty()

Marks all level components render state as dirty

Public function

void

 

OnApplyNewLightingData

(
    bool bLightingSuccessful
)

Called after lighting was built and data gets propagated to this level

Public function

void

 

OnLevelScriptBlueprintChanged

(
    ULevelScriptBlueprint* InBluep...
)

Called when the level script blueprint has been successfully changed and compiled.

Public function

void

 

PushPendingAutoReceiveInput

(
    APlayerController* PC
)

Push any pending auto receive input actor's input components on to the player controller's input stack

Public function

void

 

RebuildStaticNavigableGeometry()

Meant to be called only from editor, calculating and storing static geometry to be used with off-line and/or on-line navigation building

Public function

void

 

RegenerateLevelScriptActor()

Replace the existing LSA (if set) by spawning a new one based on this level's script blueprint

Public function

void

 

RegisterActorForAutoReceiveInput

(
    AActor* Actor,
    const int32 PlayerIndex
)

Register an actor that should be added to a player's input stack when they are created

Public function

void

 

ReleaseRenderingResources()

Releases rendering resources for this level.

Public function

void

 

RepairLevelScript()

Attempts to detect and fix any issues with the level script blueprint and associated objects

Public function

void

 

ResetNavList()

Resets the level nav list.

Public function

void

 

RouteActorInitialize()

Routes pre and post initialize to actors and also sets volumes.

Public function

void

 

SetCachedLevelCollection

(
    FLevelCollection*const InCache...
)

Sets the cached level collection that contains this level.

Public function

void

 

SetLevelPartition

(
    ILevelPartitionInterface* Leve...
)

Assign a level partition to this level

Public function

void

 

SetLightingScenario

(
    bool bNewIsLightingScenario
)

Sets whether this level is a lighting scenario and handles propagating the change.

Public function

void

 

SetPartitionSubLevel

(
    ULevel* SubLevel
)

Setup the provided sublevel so that it is handled by this level's partition

Public function

void

 

SetUseExternalActors

(
    bool bEnable
)

Sets if the level uses external actors mode or not.

Public function

void

 

SetWorldSettings

(
    AWorldSettings* NewWorldSettin...
)

Public function

void

 

SortActorList()

Sorts the actor list by net relevancy and static behaviour.

Public function

void

 

UpdateLevelComponents

(
    bool bRerunConstructionScripts,
    FRegisterComponentContext* Con...
)

Updates all components of actors associated with this level (aka in Actors array) and creates the BSP model components.

Public function

void

 

UpdateModelComponents()

Updates the model components associated with this level

Overridden from UObject

Name Description

Public function Virtual

void

 

BeginCacheForCookedPlatformData

(
    const ITargetPlatform* TargetP...
)

Starts caching of platform specific data for the target platform Called when cooking before serialization so that object can prepare platform specific data Not called during normal loading of objects

Public function Virtual

void

 

BeginDestroy()

Called before destroying the object.

Public function Virtual Const

bool

 

CanEditChange

(
    const FProperty* InProperty
)

Called by the editor to query whether a property of this object is allowed to be modified.

Public function Virtual

void

 

FinishDestroy()

Called to finish destroying the object.

Public function Virtual Const

bool

 

IsNameStableForNetworking()

IsNameStableForNetworking means an object can be referred to its path name (relative to outer) over the network

Public function Virtual

bool

 

IsReadyForFinishDestroy()

Called to check if the object is ready for FinishDestroy.

Public function Virtual

void

 

PostDuplicate

(
    bool bDuplicateForPIE
)

Called after duplication & serialization and before PostLoad.

Public function Virtual

void

 

PostEditChangeProperty

(
    FPropertyChangedEvent& PropertyCha...
)

Called when a property on this object has been modified externally

Public function Virtual

void

 

PostEditUndo()

Called after applying a transaction to the object.

Public function Virtual

void

 

PostInitProperties()

Called after the C++ constructor and after the properties have been initialized, including those loaded from config.

Public function Virtual

void

 

PostLoad()

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

Public function Virtual

void

 

PreDuplicate

(
    FObjectDuplicationParameters& DupP...
)

Called before duplication.

Public function Virtual

void

 

PreEditUndo()

Called before applying a transaction to the object.

Public function Virtual

void

 

PreSave

(
    const ITargetPlatform* TargetP...
)

Presave function.

Public function Virtual

void

 

Serialize

(
    FArchive& Ar
)

Handles reading, writing, and reference collecting using FArchive.

Overridden from UObjectBaseUtility

Name Description

Public function Virtual Const

bool

 

CanBeClusterRoot()

Called after load to determine if the object can be a cluster root

Public function Virtual

void

 

CreateCluster()

Called after PostLoad to create UObject cluster

Overridden from IInterface_AssetUserData

Name Description

Public function Virtual

void

 

AddAssetUserData

(
    UAssetUserData* InUserData
)

Public function Virtual

UAssetUserDa...

 

GetAssetUserDataOfClass

(
    TSubclassOf< UAssetUserData > InUse...
)

Public function Virtual

void

 

RemoveUserDataOfClass

(
    TSubclassOf< UAssetUserData > InUse...
)

Classes

Name

Description

Public class

FLevelBoundsActorUpdatedEvent

Called when Level bounds actor has been updated

Typedefs

Name

Description

FLevelCleanupEvent

FLevelTransformEvent

Event on level transform changes.

Constants

Name

Description

LevelDirtiedEvent

Called when a level package has been dirtied.

StreamedLevelsOwningWorld

Set before calling LoadPackage for a streaming level to ensure that OwningWorld is correct on the Level

Deprecated Functions

Name Description

Public function Const

bool

 

HasVisibilityRequestPending()

Use HasVisibilityChangeRequestPending

See Also

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss