UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
Level.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "CoreMinimal.h"
8#include "UObject/Object.h"
9#include "Misc/Guid.h"
13#include "RenderCommandFence.h"
20
21// TODO: Internal headers should not be included
23
24#include <atomic>
25
26#include "Level.generated.h"
27
28class AActor;
29class ABrush;
31class ALevelBounds;
33class AWorldSettings;
35class FSceneInterface;
36class ITargetPlatform;
37class UAssetUserData;
40class UTexture2D;
41struct FLevelCollection;
46class UActorFolder;
50struct FFolder;
51
52#if WITH_EDITOR
54{
55private:
60
61 friend class UWorld;
62 friend class ULevel;
63 friend class UActorFolder;
64 friend class FWorldPartitionConverter;
65 friend class UWorldPartitionConvertCommandlet;
66 friend class FWorldPartitionLevelHelper;
68};
69
70#endif
71
72// Actor container class used to duplicate actors during cells streaming in PIE
73UCLASS(MinimalAPI)
75{
77
78public:
79 UPROPERTY()
81
82#if WITH_EDITORONLY_DATA
83 // Can be used to resolve the Actor Level while they are outered to the UActorContainer in a PIE duplication
84 UPROPERTY()
86#endif
87};
88
89USTRUCT()
91{
93
94public:
95
97 int32 Remove(UActorFolder* InActorFolder) { return ActorFolders.Remove(InActorFolder); }
98 bool IsEmpty() const { return ActorFolders.IsEmpty(); }
99 const TSet<TObjectPtr<UActorFolder>>& GetActorFolders() const { return ActorFolders; }
100
101private:
102
104 TSet<TObjectPtr<UActorFolder>> ActorFolders;
105};
106
111USTRUCT()
113{
115
116
118
120 float MinDistance;
123
125 float TexelFactor;
126
135};
136
140USTRUCT()
142{
144
145
146 UPROPERTY()
148
150 UPROPERTY()
151 bool bAttached = false;
152
154 UPROPERTY()
155 float OriginalRadius = 0.0f;
156
165};
166
176
179{
180public:
181
184
187
190
192 {
193 Ar << D.Min << D.ChunkIndex << D.DataOffset;
194 return Ar;
195 }
196};
197
200{
201public:
204
207
210
212 {
213 Ar << D.bCompressed << D.UncompressedSize << D.Data;
214 return Ar;
215 }
216};
217
220{
221public:
224
227
230
232 {
233 Ar << D.CellDataSize << D.Cells << D.CellDataChunks;
234 return Ar;
235 }
236};
237
240{
241public:
242
244 Id(NextId)
245 {
246 NextId++;
247 }
248
253
256
259
262
264 ENGINE_API void ApplyWorldOffset(const FVector& InOffset);
265
267 int32 GetId() const { return Id; }
268
270
271private:
272
274 FVector2D PrecomputedVisibilityCellBucketOriginXY;
275
277 float PrecomputedVisibilityCellSizeXY;
278
280 float PrecomputedVisibilityCellSizeZ;
281
283 int32 PrecomputedVisibilityCellBucketSizeXY;
284
286 int32 PrecomputedVisibilityNumCellBuckets;
287
288 static int32 NextId;
289
291 int32 Id;
292
294 TArray<FPrecomputedVisibilityBucket> PrecomputedVisibilityCellBuckets;
295
297 friend class FSceneViewState;
298};
299
302{
303public:
304
307
310
312
313private:
315 float VolumeMaxDistance;
317 FBox VolumeBox;
319 int32 VolumeSizeX;
321 int32 VolumeSizeY;
323 int32 VolumeSizeZ;
325 TArray<FColor> Data;
326
327 friend class FScene;
329};
330
331USTRUCT()
333{
335
336
337 UPROPERTY(Category=General, EditAnywhere)
338 bool bCreatePackagePerAsset;
339
341 UPROPERTY(Category=StaticMesh, EditAnywhere, meta=(DisplayName="Static Mesh Details Percentage", ClampMin = "0", ClampMax = "100", UIMin = "0", UIMax = "100"))
342 float DetailsPercentage;
343
345 UPROPERTY(Category = Landscape, EditAnywhere)
346 FMaterialProxySettings StaticMeshMaterialSettings;
347
348 UPROPERTY(Category = Landscape, EditAnywhere, meta=(InlineEditConditionToggle))
349 bool bOverrideLandscapeExportLOD;
350
352 UPROPERTY(Category=Landscape, EditAnywhere, meta=(ClampMin = "0", ClampMax = "7", UIMin = "0", UIMax = "7", editcondition = "bOverrideLandscapeExportLOD"))
353 int32 LandscapeExportLOD;
354
356 UPROPERTY(Category = Landscape, EditAnywhere)
357 FMaterialProxySettings LandscapeMaterialSettings;
358
360 UPROPERTY(Category=Landscape, EditAnywhere)
361 bool bBakeFoliageToLandscape;
362
364 UPROPERTY(Category=Landscape, EditAnywhere)
365 bool bBakeGrassToLandscape;
366
368 ENGINE_API bool operator == (const FLevelSimplificationDetails& Other) const;
369};
370
376USTRUCT()
388
389#if WITH_EDITORONLY_DATA
391UENUM()
393{
394 Original, // Original scheme: ZZ/ZZ/... (maximum 1679616 folders, ~0.6 files per folder with 1000000 files)
395 Reduced // Reduced scheme: Z/ZZ/... (maximum 46656 folders, ~21.4 files per folder with 1000000 files)
396};
397#endif
398
399// Whether the level is in the process of being made visible or invisible (refer to bIsVisible when None).
406
407//
408// The level object. Contains the level's actor list, BSP information, and brush list.
409// Every Level has a World as its Outer and can be used as the PersistentLevel, however,
410// when a Level has been streamed in the OwningWorld represents the World that it is a part of.
411//
412
413
421UCLASS(MinimalAPI)
423{
425
426public:
427
430
433
436
438 ENGINE_API bool TryAddActorToList(AActor* InActor, bool bAddUnique);
439
440#if WITH_EDITORONLY_DATA
442
444 UPROPERTY(EditInstanceOnly, Category=World)
446#endif
447
450
457 TObjectPtr<UWorld> OwningWorld;
458
460 UPROPERTY()
462
464 UPROPERTY()
465 TArray<TObjectPtr<class UModelComponent>> ModelComponents;
466
467 UPROPERTY(Transient, DuplicateTransient, NonTransactional)
469
470#if WITH_EDITORONLY_DATA
472 UPROPERTY(NonTransactional)
474
476 UPROPERTY(NonTransactional)
478#endif //WITH_EDITORONLY_DATA
479
481 UPROPERTY(NonTransactional)
482 int32 NumTextureStreamingUnbuiltComponents;
483
485 UPROPERTY(NonTransactional)
486 int32 NumTextureStreamingDirtyResources;
487
489 UPROPERTY(NonTransactional)
490 TObjectPtr<class ALevelScriptActor> LevelScriptActor;
491
496 UPROPERTY()
498 UPROPERTY()
500
502 UPROPERTY()
504
506 UPROPERTY(VisibleAnywhere, Category=Level)
507 float LightmapTotalSize;
509 UPROPERTY(VisibleAnywhere, Category=Level)
510 float ShadowmapTotalSize;
511
514 UPROPERTY()
515 TArray<FVector> StaticNavigableGeometry;
516
518 UPROPERTY()
519 TArray<FGuid> StreamingTextureGuids;
520
522 UPROPERTY()
523 TArray<FName> StreamingTextures;
524
526 UPROPERTY()
527 uint32 PackedTextureStreamingQualityLevelFeatureLevel;
528
530 class FTickTaskLevel* TickTaskLevel;
531
536 class FPrecomputedLightVolume* PrecomputedLightVolume;
537
539 class FPrecomputedVolumetricLightmap* PrecomputedVolumetricLightmap;
540
542 FPrecomputedVisibilityHandler PrecomputedVisibilityHandler;
543
545 FPrecomputedVolumeDistanceField PrecomputedVolumeDistanceField;
546
548 FRenderCommandFence RemoveFromSceneFence;
549
551 UPROPERTY()
552 FGuid LevelBuildDataId;
553
558 UPROPERTY(NonPIEDuplicateTransient)
560
562 UPROPERTY()
563 FIntVector LightBuildLevelOffset;
564
566 class FVolumetricLightmapGridManager* VolumetricLightmapGridManager = nullptr;
567
574 UPROPERTY()
575 uint8 bIsLightingScenario:1;
576
578 uint8 bAreComponentsCurrentlyRegistered:1;
579
581 uint8 bGeometryDirtyForLighting:1;
582
584 UPROPERTY()
585 uint8 bTextureStreamingRotationChanged : 1;
586
592 UPROPERTY(Transient, DuplicateTransient, NonTransactional)
593 uint8 bStaticComponentsRegisteredInStreamingManager: 1;
594
600 uint8 bIsVisible:1;
601
602#if WITH_EDITORONLY_DATA
606 UPROPERTY()
607 uint8 bLocked:1;
608
611
614
615private:
618
621#endif
622
625
626public:
665
667 UPROPERTY()
668 uint8 bIsPartitioned : 1;
669
671 {
672 Init,
673 PreRegisterInitialComponents,
674 RegisterInitialComponents,
675#if WITH_EDITOR
677#endif
679 };
680
681 UE_DEPRECATED(5.5, "This property shouldn't be used anymore.")
682 uint8 bHasCurrentActorCalledPreRegister:1;
683
684private:
686 ELevelPendingVisibilityState PendingVisibilityState:2;
687
688public:
690 EIncrementalComponentState IncrementalComponentState;
692 int32 CurrentActorIndexForIncrementalUpdate;
694 int32 CurrentActorIndexForUnregisterComponents;
695
696
698 ENGINE_API bool HasVisibilityChangeRequestPending() const;
699
700 // Event on level transform changes
702 FLevelTransformEvent OnApplyLevelTransform;
703
704 // Event on level cleanup
706 FLevelCleanupEvent OnCleanupLevel;
707
708#if WITH_EDITORONLY_DATA
710 UPROPERTY()
712
717 UPROPERTY()
718 FLinearColor LevelColor;
719
721 std::atomic<uint32> FixupOverrideVertexColorsCount = 0;
722
725
728
729 UPROPERTY()
731
732#endif //WITH_EDITORONLY_DATA
733
736
739
742 FLevelBoundsActorUpdatedEvent& LevelBoundsActorUpdated() { return LevelBoundsActorUpdatedEvent; }
744 void BroadcastLevelBoundsActorUpdated() { LevelBoundsActorUpdatedEvent.Broadcast(); }
745
747 ENGINE_API void MarkLevelBoundsDirty();
748
749#if WITH_EDITOR
752
755
758
761
764
767
770
773
774 UE_DEPRECATED(5.3, "GetPartitionedLevelCanBeUsedByLevelInstanceFromAsset is deprecated.")
776 UE_DEPRECATED(5.3, "GetPartitionedLevelCanBeUsedByLevelInstanceFromPackage is deprecated.")
778 UE_DEPRECATED(5.4, "GetLevelScriptExternalActorsReferencesFromAsset is deprecated.")
780 UE_DEPRECATED(5.4, "GetLevelScriptExternalActorsReferencesFromPackageis deprecated.")
782
785
789
792
794 virtual UObject* GetEditorPathOwner() const override { return EditorPathOwner.Get(); }
795
798#endif
799
800private:
801 enum class EIncrementalUnregisterComponentState : uint8
802 {
803 Init,
804 PreUnregisterComponents,
805 UnregisterComponents,
807 };
808
809 EIncrementalUnregisterComponentState IncrementalUnregisterComponentState;
810
811 FLevelBoundsActorUpdatedEvent LevelBoundsActorUpdatedEvent;
812
813 UPROPERTY()
814 TObjectPtr<AWorldSettings> WorldSettings;
815
816 UPROPERTY()
817 TObjectPtr<AWorldDataLayers> WorldDataLayers;
818
819 UPROPERTY()
820 TSoftObjectPtr<UWorldPartitionRuntimeCell> WorldPartitionRuntimeCell;
821
823 FLevelCollection* CachedLevelCollection;
824
825 void OnPreRegisterComponent(UActorComponent* Component)
826 {
828 PreRegisteringActorComponents.Add(Component);
829 }
830
831 void OnRemovedPreRegisteringComponent(UActorComponent* Component)
832 {
834 verify(PreRegisteringActorComponents.Remove(Component));
835 }
836
837 void OnPreRegisteredComponent(UActorComponent* Component)
838 {
839 OnRemovedPreRegisteringComponent(Component);
840 }
841
842 bool HasPreRegisteringComponents() const
843 {
844 return PreRegisteringActorComponents.Num() > 0;
845 }
846
847 void OnPreUnregisterComponent(UActorComponent* Component)
848 {
850 PreUnregisteringActorComponents.Add(Component);
851 }
852
853 void OnRemovedPreUnregisteringComponent(UActorComponent* Component)
854 {
856 verify(PreUnregisteringActorComponents.Remove(Component));
857 }
858
859 void OnPreUnregisteredComponent(UActorComponent* Component)
860 {
861 OnRemovedPreUnregisteringComponent(Component);
862 }
863
864 bool HasPreUnregisteringComponents() const
865 {
866 return PreUnregisteringActorComponents.Num() > 0;
867 }
868
869 ENGINE_API void CreateAsyncRegisterLevelContext();
870 ENGINE_API void DestroyAsyncRegisterLevelContext();
871
872 TUniquePtr<FAsyncRegisterLevelContext> AsyncRegisterLevelContext;
873 TSet<UActorComponent*> PreUnregisteringActorComponents;
874 TSet<UActorComponent*> PreRegisteringActorComponents;
878
879protected:
880
882 UPROPERTY()
884
885private:
886 // Actors awaiting input to be enabled once the appropriate PlayerController has been created
887 TArray<FPendingAutoReceiveInputActor> PendingAutoReceiveInputActors;
888
891 TArray<FReplicatedStaticActorDestructionInfo> DestroyedReplicatedStaticActors;
892
893#if WITH_EDITORONLY_DATA
895 UPROPERTY(EditInstanceOnly, Category = World)
896 bool bUseActorFolders;
897
901
905
909
911 TWeakObjectPtr<UObject> EditorPathOwner;
912#endif // #if WITH_EDITORONLY_DATA
913
914 enum class ERouteActorInitializationState : uint8
915 {
916 Preinitialize,
918 BeginPlay,
920 };
921 ERouteActorInitializationState RouteActorInitializationState;
922 int32 RouteActorInitializationIndex;
923 int32 RouteActorEndPlayForRemoveFromWorldIndex;
924
925public:
926 // Used internally to determine which actors should go on the world's NetworkActor list
927 ENGINE_API static bool IsNetActor(const AActor* Actor);
928
930 void CreateReplicatedDestructionInfo(AActor* const Actor);
931
932 const TArray<FReplicatedStaticActorDestructionInfo>& GetDestroyedReplicatedStaticActors() const;
933
934 //** DO NOT USE - Part of internal networking implentation iteration. */
935 ENGINE_API void AddReplicatedDestructionInfo(AActor* const Actor);
936
939
940 // Constructor.
941 ENGINE_API void Initialize(const FURL& InURL);
943
946 : Super(Helper)
947 , Actors()
948 {}
949
950 ~ULevel();
951
952 //~ Begin UObject Interface.
953 virtual void PostInitProperties() override;
954 virtual void Serialize( FArchive& Ar ) override;
955 virtual void BeginDestroy() override;
956 virtual bool IsReadyForFinishDestroy() override;
957 virtual void FinishDestroy() override;
958 ENGINE_API virtual UWorld* GetWorld() const override final;
959
960#if WITH_EDITOR
961 virtual void PreEditUndo() override;
962 virtual void PostEditUndo() override;
963 virtual void PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent) override;
964 virtual void BeginCacheForCookedPlatformData(const ITargetPlatform *TargetPlatform) override;
965#endif // WITH_EDITOR
966 virtual bool ResolveSubobject(const TCHAR* SubObjectPath, UObject*& OutObject, bool bLoadIfExists) override;
967 virtual void PostLoad() override;
968 virtual void PreSave(FObjectPreSaveContext ObjectSaveContext) override;
969 virtual void PreDuplicate(FObjectDuplicationParameters& DupParams) override;
970 virtual bool CanBeClusterRoot() const override;
971 virtual void CreateCluster() override;
972 static void AddReferencedObjects(UObject* InThis, FReferenceCollector& Collector);
973 //~ End UObject Interface.
974
975 void PreSaveFromRoot(FObjectPreSaveRootContext ObjectSaveContext);
976 void PostSaveFromRoot(FObjectPostSaveRootContext ObjectSaveContext);
977
978#if WITH_EDITOR
981
982 //~Begin ITextureStreamingContainer Interface.
985 //~End ITextureStreamingContainer Interface.
987#endif
988
996 ENGINE_API void CleanupLevel(bool bCleanupResources = true, bool bUnloadFromEditor = true);
997
1002 ENGINE_API void ClearLevelComponents();
1003
1009 ENGINE_API void UpdateLevelComponents(bool bRerunConstructionScripts, FRegisterComponentContext* Context = nullptr);
1010
1017 void IncrementalUpdateComponents( int32 NumComponentsToUpdate, bool bRerunConstructionScripts, FRegisterComponentContext* Context = nullptr);
1018
1025 bool IncrementalUnregisterComponents(int32 NumComponentsToUnregister, FUnregisterComponentContext* Context = nullptr);
1026
1027
1031 void InvalidateModelGeometry();
1032
1034 ENGINE_API void MarkLevelComponentsRenderStateDirty();
1035
1036#if WITH_EDITOR
1038 void CreateModelComponents();
1039#endif // WITH_EDITOR
1040
1044 ENGINE_API void UpdateModelComponents();
1045
1049 ENGINE_API void CommitModelSurfaces();
1050
1055 void InvalidateModelSurface();
1056
1062 ENGINE_API void SortActorList();
1063
1064#if WITH_EDITOR
1073
1082
1086
1090
1094
1098
1102
1106#endif
1107
1108 /* Called when level is loaded. */
1109 ENGINE_API void OnLevelLoaded();
1110
1111 virtual bool IsNameStableForNetworking() const override { return true; } // For now, assume all levels have stable net names
1112
1114 void InitializeNetworkActors();
1115
1116 void ClearActorsSeamlessTraveledFlag();
1117
1119 ENGINE_API void InitializeRenderingResources();
1120
1122 ENGINE_API void ReleaseRenderingResources();
1123
1127 bool IsFinishedRouteActorInitialization() const { return RouteActorInitializationState == ERouteActorInitializationState::Finished; }
1128
1132 void ResetRouteActorInitializationState();
1133
1140 void RouteActorInitialize(int32 NumActorsToProcess);
1141
1149 ENGINE_API static void BuildStreamingData(UWorld* World, ULevel* TargetLevel=NULL, UTexture2D* TargetTexture=NULL);
1150
1156 ENGINE_API ABrush* GetDefaultBrush() const;
1157
1163 ENGINE_API AWorldSettings* GetWorldSettings(bool bChecked = true) const;
1164
1165 ENGINE_API void SetWorldSettings(AWorldSettings* NewWorldSettings);
1166
1172 ENGINE_API AWorldDataLayers* GetWorldDataLayers() const;
1173
1174 ENGINE_API void SetWorldDataLayers(AWorldDataLayers* NewWorldDataLayers);
1175
1181 ENGINE_API const IWorldPartitionCell* GetWorldPartitionRuntimeCell() const;
1182
1188 bool IsWorldPartitionRuntimeCell() const { return !WorldPartitionRuntimeCell.GetUniqueID().IsNull(); }
1189
1195 ENGINE_API class UWorldPartition* GetWorldPartition() const;
1196
1201 ENGINE_API class ALevelScriptActor* GetLevelScriptActor() const;
1202
1204 FLevelCollection* GetCachedLevelCollection() const { return CachedLevelCollection; }
1205
1208
1212 bool HasAnyActorsOfType(UClass *SearchType);
1213
1218
1219 ENGINE_API UPackage* CreateMapBuildDataPackage() const;
1220
1221 ENGINE_API UMapBuildDataRegistry* GetOrCreateMapBuildData();
1222
1223 ENGINE_API bool IsMapBuildDataOwner() const;
1224
1226 ENGINE_API ELevelPendingVisibilityState GetPendingVisibilityState() const;
1227
1229 ENGINE_API void SetLightingScenario(bool bNewIsLightingScenario);
1230
1232 ENGINE_API void HandleLegacyMapBuildData();
1233
1234#if WITH_EDITOR
1244
1250 static ENGINE_API FString ResolveRootPath(const FString& LevelPackageName, const UObject* InLevelMountPointContext = nullptr);
1251
1260
1267 static ENGINE_API FString GetExternalActorsPath(const FString& InLevelPackageName, const FString& InPackageShortName = FString());
1268
1275 static ENGINE_API TArray<FString> GetExternalActorsPaths(const FString& InLevelPackageName, const FString& InPackageShortName = FString());
1276
1283 static ENGINE_API FString GetExternalActorsPath(UPackage* InLevelPackage, const FString& InPackageShortName = FString());
1284
1289
1293 static ENGINE_API void ScanLevelAssets(const FString& InLevelPackageName);
1294
1299 static ENGINE_API const TCHAR* GetExternalActorsFolderName();
1300
1302 ENGINE_API bool IsUsingExternalActors() const;
1303
1305 ENGINE_API void SetUseExternalActors(bool bEnable);
1306
1313 static ENGINE_API TArray<FString> GetExternalObjectsPaths(const FString& InLevelPackageName, const FString& InPackageShortName = FString());
1314
1317
1319 ENGINE_API bool IsUsingActorFolders() const;
1320
1323
1326
1328 ENGINE_API bool SetUseActorFolders(bool bEnabled, bool bInteractive = false);
1329
1331 ENGINE_API UActorFolder* GetActorFolder(const FGuid& InGuid, bool bSkipDeleted = true) const;
1332
1335
1337 ENGINE_API void ForEachActorFolder(TFunctionRef<bool(UActorFolder*)> Operation, bool bSkipDeleted = false);
1338
1341
1344
1350 ENGINE_API void ConvertAllActorsToPackaging(bool bExternal);
1351
1356 static ENGINE_API FString GetExternalActorPackageInstanceName(const FString& LevelPackageName, const FString& ActorPackageName);
1357
1364
1370
1376
1386
1392
1399
1404
1409
1413 ENGINE_API void FixupForPIE(int32 PIEInstanceID);
1414 ENGINE_API void FixupForPIE(int32 PIEInstanceID, TFunctionRef<void(int32, FSoftObjectPath&)> CustomFixupFunction);
1415
1420#endif
1421
1423 TArray<FVector> const* GetStaticNavigableGeometry() const { return &StaticNavigableGeometry;}
1424
1428 ENGINE_API bool IsPersistentLevel() const;
1429
1433 ENGINE_API bool IsCurrentLevel() const;
1434
1438 ENGINE_API bool IsInstancedLevel() const;
1439
1447 ENGINE_API void ApplyWorldOffset(const FVector& InWorldOffset, bool bWorldShift);
1448
1450 void RegisterActorForAutoReceiveInput(AActor* Actor, const int32 PlayerIndex);
1451
1453 void PushPendingAutoReceiveInput(APlayerController* PC);
1454
1455 //~ Begin IInterface_AssetUserData Interface
1456 virtual void AddAssetUserData(UAssetUserData* InUserData) override;
1457 virtual void RemoveUserDataOfClass(TSubclassOf<UAssetUserData> InUserDataClass) override;
1458 virtual UAssetUserData* GetAssetUserDataOfClass(TSubclassOf<UAssetUserData> InUserDataClass) override;
1459 //~ End IInterface_AssetUserData Interface
1460
1462 int32 GetEstimatedAddToWorldWorkUnitsRemaining() const;
1464 int32 GetEstimatedAddToWorldWorkUnitsTotal() const;
1465
1466#if WITH_EDITOR
1472
1473 DECLARE_DELEGATE_RetVal_ThreeParams(bool, FLevelMountPointResolverDelegate, const FString&, const UObject*, FString&);
1479 static const UObject* GetOverrideSpawningLevelMountPointObject() { return ULevel::OverrideSpawningLevelMountPointObject.Get(); }
1480#endif
1481
1482private:
1483 void RouteActorEndPlayForRemoveFromWorld(int32 NumActorsToProcess);
1484 void ResetRouteActorEndPlayForRemoveFromWorld();
1485 bool IsFinishedRouteActorEndPlayForRemoveFromWorld() const;
1486
1487 bool IncrementalPreRegisterComponents(FRegisterComponentContext& Context);
1488 bool IncrementalRegisterComponents(FRegisterComponentContext& Context);
1489 bool IncrementalPreUnregisterComponents(FUnregisterComponentContext& Context);
1490#if WITH_EDITOR
1493
1496
1499
1502private:
1511
1513 void RepairLevelScript();
1514
1516 void FixupActorFolders();
1517
1522
1525
1528
1530 friend struct FLevelActorFoldersHelper;
1531 friend struct FSetWorldPartitionRuntimeCell;
1532 friend class FWorldPartitionLevelHelper;
1533 friend class UActorFolder;
1534 friend class AWorldDataLayers;
1535 friend class UWorldPartitionRuntimeHashSet;
1536
1539
1542
1547
1548#endif // WITH_EDITOR
1549};
1550
1553{
1554private:
1555 static void RouteActorEndPlayForRemoveFromWorld(ULevel* InLevel, int32 InNumActorsToProcess)
1556 {
1557 InLevel->RouteActorEndPlayForRemoveFromWorld(InNumActorsToProcess);
1558 }
1559
1560 static void ResetRouteActorEndPlayForRemoveFromWorld(ULevel* InLevel)
1561 {
1562 InLevel->ResetRouteActorEndPlayForRemoveFromWorld();
1563 }
1564
1565 static bool IsFinishedRouteActorEndPlayForRemoveFromWorld(ULevel* InLevel)
1566 {
1567 return InLevel->IsFinishedRouteActorEndPlayForRemoveFromWorld();
1568 }
1569
1570 friend class UWorld;
1571};
1572
1575{
1576private:
1577 static void OnPreRegisterComponent(ULevel* InLevel, UActorComponent* InComponent)
1578 {
1579 InLevel->OnPreRegisterComponent(InComponent);
1580 }
1581
1582 static void OnPreRegisteredComponent(ULevel* InLevel, UActorComponent* InComponent)
1583 {
1584 InLevel->OnPreRegisteredComponent(InComponent);
1585 }
1586
1587 static void OnRemovedPreRegisteringComponent(ULevel* InLevel, UActorComponent* InComponent)
1588 {
1589 InLevel->OnRemovedPreRegisteringComponent(InComponent);
1590 }
1591
1592 static bool HasPreRegisteringComponents(const ULevel* InLevel)
1593 {
1594 return InLevel->HasPreRegisteringComponents();
1595 }
1596
1597 static void OnPreUnregisterComponent(ULevel* InLevel, UActorComponent* InComponent)
1598 {
1599 InLevel->OnPreUnregisterComponent(InComponent);
1600 }
1601
1602 static void OnPreUnregisteredComponent(ULevel* InLevel, UActorComponent* InComponent)
1603 {
1604 InLevel->OnPreUnregisteredComponent(InComponent);
1605 }
1606
1607 static void OnRemovedPreUnregisteringComponent(ULevel* InLevel, UActorComponent* InComponent)
1608 {
1609 InLevel->OnRemovedPreUnregisteringComponent(InComponent);
1610 }
1611
1612 static bool HasPreUnregisteringComponents(const ULevel* InLevel)
1613 {
1614 return InLevel->HasPreUnregisteringComponents();
1615 }
1616
1617 static void CreateAsyncRegisterLevelContext(ULevel* InLevel)
1618 {
1619 InLevel->CreateAsyncRegisterLevelContext();
1620 }
1621
1622 static void DestroyAsyncRegisterLevelContext(ULevel* InLevel)
1623 {
1624 InLevel->DestroyAsyncRegisterLevelContext();
1625 }
1626
1627 static FAsyncRegisterLevelContext* GetAsyncRegisterLevelContext(ULevel* InLevel)
1628 {
1629 return InLevel ? InLevel->AsyncRegisterLevelContext.Get() : nullptr;
1630 }
1631
1633 friend class UActorComponent;
1634 friend class UWorld;
1635};
1636
1638{
1639private:
1640 static void SetPendingVisibilityState(ULevel* InLevel, ELevelPendingVisibilityState InState)
1641 {
1642 InLevel->PendingVisibilityState = InState;
1643 }
1644
1645 friend class UWorld;
1646};
1647
1648#if WITH_EDITOR
1650{
1652 {
1653 PreviousValue = ULevel::OverrideSpawningLevelMountPointObject;
1654 ULevel::OverrideSpawningLevelMountPointObject = InObject;
1655 }
1657 {
1658 ULevel::OverrideSpawningLevelMountPointObject = PreviousValue;
1659 }
1660private:
1661 TWeakObjectPtr<const UObject> PreviousValue;
1662};
1663
1665{
1666private:
1668 {
1669 InLevel->WorldPartitionRuntimeCell = InWorldPartitionRuntimeCell;
1670 }
1671 friend class FWorldPartitionLevelHelper;
1672 friend class UWorldPartition;
1673};
1674#endif
1675
1679 #define DECLARE_SCOPED_DELEGATE( CallbackName, TriggerFunc ) \
1680 class FScoped##CallbackName##Impl \
1681 { \
1682 public: \
1683 static void FireCallback() { TriggerFunc; } \
1684 }; \
1685 \
1686 typedef TScopedCallback<FScoped##CallbackName##Impl> FScoped##CallbackName;
1687
1689
1690#undef DECLARE_SCOPED_DELEGATE
#define NULL
Definition oodle2base.h:134
PlayerIndex
Definition AppleControllerInterface.h:24
#define check(expr)
Definition AssertionMacros.h:314
#define verify(expr)
Definition AssertionMacros.h:319
#define UE_DEPRECATED(Version, Message)
Definition CoreMiscDefines.h:302
FPlatformTypes::TCHAR TCHAR
Either ANSICHAR or WIDECHAR, depending on whether the platform supports wide characters or the requir...
Definition Platform.h:1135
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
FPlatformTypes::uint64 uint64
A 64-bit unsigned integer.
Definition Platform.h:1117
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
#define DECLARE_EVENT_OneParam(OwningType, EventName, Param1Type)
Definition DelegateCombinations.h:51
#define DECLARE_MULTICAST_DELEGATE(DelegateName)
Definition DelegateCombinations.h:23
#define DECLARE_DELEGATE_ThreeParams(DelegateName, Param1Type, Param2Type, Param3Type)
Definition DelegateCombinations.h:66
#define DECLARE_MULTICAST_DELEGATE_OneParam(DelegateName, Param1Type)
Definition DelegateCombinations.h:49
#define DECLARE_DELEGATE_RetVal_ThreeParams(ReturnValueType, DelegateName, Param1Type, Param2Type, Param3Type)
Definition DelegateCombinations.h:72
ELevelPendingVisibilityState
Definition Level.h:401
#define DECLARE_SCOPED_DELEGATE(CallbackName, TriggerFunc)
Definition Level.h:1679
void Init()
Definition LockFreeList.h:4
@ General
Definition MaterialExpressionFunctionInput.h:41
const bool
Definition NetworkReplayStreaming.h:178
#define UPROPERTY(...)
UObject definition macros.
Definition ObjectMacros.h:744
#define GENERATED_BODY(...)
Definition ObjectMacros.h:765
#define UCLASS(...)
Definition ObjectMacros.h:776
#define UENUM(...)
Definition ObjectMacros.h:749
#define USTRUCT(...)
Definition ObjectMacros.h:746
#define GENERATED_USTRUCT_BODY(...)
Definition ObjectMacros.h:767
@ Percentage
#define WORLDTILE_LOD_MAX_INDEX
Definition WorldCompositionUtility.h:23
uint8_t uint8
Definition binka_ue_file_header.h:8
uint16_t uint16
Definition binka_ue_file_header.h:7
uint32_t uint32
Definition binka_ue_file_header.h:6
Definition Actor.h:257
Definition InstancedFoliageActor.h:29
Definition NavigationObjectBase.h:14
Definition PlayerController.h:261
Definition WorldDataLayers.h:85
Definition Archive.h:1208
Definition Level.h:200
bool bCompressed
Definition Level.h:203
friend FArchive & operator<<(FArchive &Ar, FCompressedVisibilityChunk &D)
Definition Level.h:211
int32 UncompressedSize
Definition Level.h:206
TArray< uint8 > Data
Definition Level.h:209
Definition IDelegateInstance.h:14
Definition NameTypes.h:617
Definition UObjectGlobals.h:1292
static COREUOBJECT_API FObjectInitializer & Get()
Definition UObjectGlobals.cpp:5001
Definition ObjectSaveContext.h:554
Definition ObjectSaveContext.h:244
Definition ObjectSaveContext.h:535
Definition PrecomputedLightVolume.h:151
Definition Level.h:220
int32 CellDataSize
Definition Level.h:223
TArray< FPrecomputedVisibilityCell > Cells
Definition Level.h:226
TArray< FCompressedVisibilityChunk > CellDataChunks
Definition Level.h:229
friend FArchive & operator<<(FArchive &Ar, FPrecomputedVisibilityBucket &D)
Definition Level.h:231
Definition Level.h:179
uint16 ChunkIndex
Definition Level.h:186
FVector Min
Definition Level.h:183
uint16 DataOffset
Definition Level.h:189
friend FArchive & operator<<(FArchive &Ar, FPrecomputedVisibilityCell &D)
Definition Level.h:191
Definition Level.h:240
ENGINE_API void UpdateVisibilityStats(bool bAllocating) const
Definition Level.cpp:263
int32 GetId() const
Definition Level.h:267
ENGINE_API void ApplyWorldOffset(const FVector &InOffset)
Definition Level.cpp:320
friend FArchive & operator<<(FArchive &Ar, FPrecomputedVisibilityHandler &D)
Definition Level.cpp:332
FPrecomputedVisibilityHandler()
Definition Level.h:243
ENGINE_API void UpdateScene(FSceneInterface *Scene) const
Definition Level.cpp:294
~FPrecomputedVisibilityHandler()
Definition Level.h:249
friend class FLightmassProcessor
Definition Level.h:296
Definition Level.h:302
friend FArchive & operator<<(FArchive &Ar, FPrecomputedVolumeDistanceField &D)
Definition Level.cpp:369
ENGINE_API void UpdateScene(FSceneInterface *Scene) const
Definition Level.cpp:349
friend class FLightmassProcessor
Definition Level.h:328
Definition PrecomputedVolumetricLightmap.h:223
Definition UObjectGlobals.h:2492
Definition ActorComponent.h:47
Definition RenderCommandFence.h:15
Definition SceneInterface.h:106
Definition ScenePrivate.h:746
Definition ScenePrivate.h:2875
Definition TickTaskManager.cpp:1206
Definition UnregisterComponentContext.h:10
Definition ObjectMacros.h:180
Definition PrecomputedVolumetricLightmapStreaming.h:20
Definition WorldPartitionLevelHelper.h:23
Definition EditorPathObjectInterface.h:28
Definition Interface_AssetUserData.h:20
Definition WorldPartitionRuntimeCellInterface.h:19
Definition Landscape.Build.cs:7
Definition SNotificationList.h:25
Definition Array.h:670
Definition AssetRegistryState.h:50
Definition UnrealString.h.inl:34
Definition SubclassOf.h:30
Definition UniquePtr.h:107
Definition SharedPointer.h:1295
Definition ActorComponent.h:152
Definition Level.h:75
Definition ActorFolder.h:17
Definition AssetUserData.h:18
Definition Class.h:3793
Definition LevelActorContainer.h:18
Definition LevelScriptBlueprint.h:25
Definition Level.h:423
FLevelCollection * GetCachedLevelCollection() const
Definition Level.h:1204
uint8 bIsAssociatingLevel
Definition Level.h:644
uint8 bRequireFullVisibilityToRender
Definition Level.h:648
FLevelBoundsActorUpdatedEvent & LevelBoundsActorUpdated()
Definition Level.h:742
DECLARE_EVENT(ULevel, FLevelBoundsActorUpdatedEvent)
uint8 bAlreadyShiftedActors
Definition Level.h:632
ENGINE_API void ResetNavList()
TArray< TObjectPtr< AActor > > ActorsForGC
Definition Level.h:435
uint8 bIsMapBuildDataOwner
Definition Level.h:624
uint8 bWasDuplicatedForPIE
Definition Level.h:654
uint8 bHasRerunConstructionScripts
Definition Level.h:660
uint8 bClientOnlyVisible
Definition Level.h:650
TWeakObjectPtr< ALevelBounds > LevelBoundsActor
Definition Level.h:735
void BroadcastLevelBoundsActorUpdated()
Definition Level.h:744
TArray< FVector > const * GetStaticNavigableGeometry() const
Definition Level.h:1423
uint8 bIncrementalUnregisterComponentsCompleted
Definition Level.h:658
ULevel(FVTableHelper &Helper)
Definition Level.h:945
uint8 bIsDisassociatingLevel
Definition Level.h:646
bool IsWorldPartitionRuntimeCell() const
Definition Level.h:1188
EIncrementalComponentState
Definition Level.h:671
uint8 bAlreadyInitializedNetworkActors
Definition Level.h:638
void SetCachedLevelCollection(FLevelCollection *const InCachedLevelCollection)
Definition Level.h:1207
uint8 bAlreadyMovedActors
Definition Level.h:630
uint8 bAlreadyUpdatedComponents
Definition Level.h:634
static ENGINE_API TMap< FName, TWeakObjectPtr< UWorld > > StreamedLevelsOwningWorld
Definition Level.h:449
static ENGINE_API FSimpleMulticastDelegate LevelDirtiedEvent
Definition Level.h:938
virtual bool IsNameStableForNetworking() const override
Definition Level.h:1111
uint8 bAlreadyClearedActorsSeamlessTravelFlag
Definition Level.h:640
uint8 bAlreadyAssociatedStreamableResources
Definition Level.h:636
TArray< TObjectPtr< AActor > > Actors
Definition Level.h:432
uint8 bAlreadySortedActorList
Definition Level.h:642
uint8 bActorClusterCreated
Definition Level.h:662
TWeakObjectPtr< AInstancedFoliageActor > InstancedFoliageActor
Definition Level.h:738
FURL URL
Definition Level.h:429
uint8 bIsBeingRemoved
Definition Level.h:656
uint8 bGarbageCollectionClusteringEnabled
Definition Level.h:664
uint8 bWasDuplicated
Definition Level.h:652
bool IsFinishedRouteActorInitialization() const
Definition Level.h:1127
Definition MapBuildDataRegistry.h:295
Definition ModelComponent.h:34
Definition Model.h:401
Definition NavigationDataChunk.h:17
Definition Object.h:95
Definition Package.h:216
Definition Texture2D.h:26
Definition Texture.h:1219
Definition WorldPartitionLevelStreamingDynamic.h:26
Definition WorldPartitionRuntimeCell.h:236
Definition WorldPartitionRuntimeHashSet.h:151
Definition WorldPartition.h:142
Definition World.h:918
@ false
Definition radaudio_common.h:23
Definition Level.h:91
int32 Remove(UActorFolder *InActorFolder)
Definition Level.h:97
bool IsEmpty() const
Definition Level.h:98
const TSet< TObjectPtr< UActorFolder > > & GetActorFolders() const
Definition Level.h:99
Definition AssetData.h:162
Definition AsyncRegisterLevelContext.h:71
Definition Level.h:142
Definition Folder.h:18
Definition Guid.h:109
Definition World.h:634
Definition Level.h:1575
Definition Level.h:1553
Definition Level.h:333
Definition Color.h:48
Definition MaterialMerging.h:34
Definition UObjectGlobals.h:147
Definition Level.h:169
TWeakObjectPtr< AActor > Actor
Definition Level.h:170
int32 PlayerIndex
Definition Level.h:171
Definition UnrealType.h:6865
Definition SoftObjectPath.h:56
Definition Level.h:113
Definition EngineBaseTypes.h:799
Definition TextureStreamingTypes.h:113
Definition ObjectPtr.h:488
Definition Optional.h:131
Definition SoftObjectPtr.h:174
Definition WeakObjectPtrTemplates.h:25
Definition BoxSphereBounds.h:25