UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
LevelUtils.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"
6
7class AActor;
8class ULevel;
10
15{
16public:
18 // Given a ULevel, find the corresponding ULevelStreaming.
19
27
36
45
55
65
74
77
80
82 // Locking/unlocking levels for edit.
83
84#if WITH_EDITOR
91 static ENGINE_API bool IsLevelLocked(ULevel* Level);
93
99 static ENGINE_API void ToggleLevelLock(ULevel* Level);
100#endif
101
103 // Controls whether the level is loaded in editor.
104
111 static ENGINE_API bool IsLevelLoaded(ULevel* Level);
112
113
115 // Level visibility.
116
122#if WITH_EDITORONLY_DATA
123 static ENGINE_API bool IsStreamingLevelVisibleInEditor(const ULevelStreaming* StreamingLevel);
124#endif
125
131 static ENGINE_API bool IsLevelVisible(const ULevel* Level);
132
133
135 {
141
142 // The level to Transform.
144
145 // If the actor is non null, directly transform only this actor
146 AActor* Actor = nullptr;
147
148 // How to Transform the level.
150
151 // Whether to call SetRelativeTransform or update the Location and Rotation in place without any other updating
153
154#if WITH_EDITOR
155 // Whether to call PostEditMove on actors after transforming
156 bool bDoPostEditMove = true;
157#endif
158 };
159
162
163#if WITH_EDITOR
165 // Level - editor transforms.
166
172 static ENGINE_API void ApplyPostEditMove( ULevel* Level );
173
181 static ENGINE_API void SetEditorTransform(ULevelStreaming* StreamingLevel, const FTransform& Transform, bool bDoPostEditMove = true);
182
190 static ENGINE_API void ApplyEditorTransform(const ULevelStreaming* StreamingLevel, bool bDoPostEditMove = true, AActor* Actor = nullptr);
191
199 static ENGINE_API void RemoveEditorTransform(const ULevelStreaming* StreamingLevel, bool bDoPostEditMove = true, AActor* Actor = nullptr);
200
204 static ENGINE_API bool IsMovingLevel();
206
207private:
208
209 // Flag to mark if we are currently finalizing a level offset
210 static ENGINE_API bool bMovingLevel;
212
213#endif // WITH_EDITOR
214};
215
FPlatformTypes::TCHAR TCHAR
Either ANSICHAR or WIDECHAR, depending on whether the platform supports wide characters or the requir...
Definition Platform.h:1135
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
Definition Actor.h:257
Definition LevelUtils.h:15
static ENGINE_API bool IsLevelVisible(const ULevel *Level)
Definition LevelUtils.cpp:314
static ENGINE_API ULevelStreaming * FindStreamingLevel(const ULevel *Level)
Definition LevelUtils.cpp:77
static ENGINE_API bool IsValidStreamingLevel(UWorld *InWorld, const TCHAR *InPackageName)
Definition LevelUtils.cpp:104
static ENGINE_API void ApplyLevelTransform(const FApplyLevelTransformParams &TransformParams)
Definition LevelUtils.cpp:455
static ENGINE_API bool IsServerStreamingLevelVisible(UWorld *InWorld, const FName &InPackageName)
Definition LevelUtils.cpp:137
static ENGINE_API ULevelStreaming * GetServerVisibleStreamingLevel(UWorld *InWorld, const FName &InPackageName)
Definition LevelUtils.cpp:149
static ENGINE_API bool IsLevelLoaded(ULevel *Level)
Definition LevelUtils.cpp:277
static ENGINE_API bool SupportsMakingVisibleTransactionRequests(UWorld *InWorld)
Definition LevelUtils.cpp:127
static ENGINE_API bool SupportsMakingInvisibleTransactionRequests(UWorld *InWorld)
Definition LevelUtils.cpp:132
Definition NameTypes.h:617
Definition LevelStreaming.h:139
Definition Level.h:423
Definition World.h:918
Definition LevelUtils.h:135
ULevel * Level
Definition LevelUtils.h:143
AActor * Actor
Definition LevelUtils.h:146
FApplyLevelTransformParams(ULevel *InLevel, const FTransform &InLevelTransform)
Definition LevelUtils.h:136
const FTransform & LevelTransform
Definition LevelUtils.h:149
bool bSetRelativeTransformDirectly
Definition LevelUtils.h:152