bOnlyLoadVisibleLevelsInPIE
bOnlyLoadVisibleLevelsInPIE
#Overview
name: bOnlyLoadVisibleLevelsInPIE
The value of this variable can be defined or overridden in .ini config files. 1
.ini config file referencing this setting variable.
It is referenced in 5
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of bOnlyLoadVisibleLevelsInPIE is to control whether only currently visible levels are loaded when playing in the editor (PIE) mode in Unreal Engine.
This setting variable is primarily used by the Level Editor and Play-in-Editor subsystems of Unreal Engine. It’s referenced in the LevelEditor, MovieSceneCaptureDialog, and UnrealEd modules.
The value of this variable is set in the ULevelEditorPlaySettings class, which is a configuration class for Play-in-Editor settings. It can be toggled through the editor UI, as evidenced by the OnToggleOnlyLoadVisibleInPIE() function in LevelEditorActions.cpp.
This variable interacts with other Play-in-Editor settings, particularly bPreferToStreamLevelsInPIE. Both of these settings affect how levels are loaded and managed during PIE sessions.
Developers should be aware that changing this setting can affect performance and memory usage during PIE sessions. When set to true, it can reduce memory usage and load times by only loading visible levels, but it may cause issues if gameplay relies on currently non-visible levels.
Best practices when using this variable include:
-
Consider the structure of your game levels. If your game heavily relies on streaming or has many interconnected levels, you might want to keep this setting off for more accurate testing.
-
Be aware that changing this setting might affect how your game behaves in PIE mode compared to a built game.
-
Use in conjunction with bPreferToStreamLevelsInPIE for fine-tuned control over level loading in PIE.
-
Remember to test your game thoroughly with this setting both on and off to ensure consistent behavior across different configurations.
-
Be cautious when changing this setting during runtime, as it can affect the game’s performance and behavior significantly.
#Setting Variables
#References In INI files
Location: <Workspace>/Engine/Config/BaseEditorPerProjectUserSettings.ini:234, section: [/Script/UnrealEd.LevelEditorPlaySettings]
- INI Section:
/Script/UnrealEd.LevelEditorPlaySettings
- Raw value:
False
- Is Array:
False
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Editor/LevelEditor/Private/LevelEditorActions.cpp:2770
Scope (from outer to inner):
file
function void FLevelEditorActionCallbacks::OnToggleOnlyLoadVisibleInPIE
Source code excerpt:
{
ULevelEditorPlaySettings* PlaySettings = GetMutableDefault<ULevelEditorPlaySettings>();
PlaySettings->bOnlyLoadVisibleLevelsInPIE = !PlaySettings->bOnlyLoadVisibleLevelsInPIE;
PlaySettings->PostEditChange();
PlaySettings->SaveConfig();
}
bool FLevelEditorActionCallbacks::OnIsOnlyLoadVisibleInPIEEnabled()
{
return GetDefault<ULevelEditorPlaySettings>()->bOnlyLoadVisibleLevelsInPIE;
}
void FLevelEditorActionCallbacks::OnToggleSocketSnapping()
{
GEditor->bEnableSocketSnapping = !GEditor->bEnableSocketSnapping;
GEditor->RedrawLevelEditingViewports();
#Loc: <Workspace>/Engine/Source/Editor/MovieSceneCaptureDialog/Private/MovieSceneCaptureDialogModule.cpp:490
Scope (from outer to inner):
file
function void FInEditorCapture::OverridePlaySettings
Source code excerpt:
PlayInEditorSettings->ShouldMinimizeEditorOnVRPIE = true;
PlayInEditorSettings->EnableGameSound = CaptureObject->AudioCaptureProtocolType != UNullAudioCaptureProtocol::StaticClass();
PlayInEditorSettings->bOnlyLoadVisibleLevelsInPIE = false;
PlayInEditorSettings->bPreferToStreamLevelsInPIE = false;
PlayInEditorSettings->PIEAlwaysOnTop = false;
PlayInEditorSettings->DisableStandaloneSound = false;
PlayInEditorSettings->AdditionalLaunchParameters = TEXT("");
PlayInEditorSettings->BuildGameBeforeLaunch = EPlayOnBuildMode::PlayOnBuild_Never;
PlayInEditorSettings->LaunchConfiguration = EPlayOnLaunchConfiguration::LaunchConfig_Default;
#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Classes/Settings/LevelEditorPlaySettings.h:281
Scope (from outer to inner):
file
class class ULevelEditorPlaySettings : public UObject
Source code excerpt:
/** True if Play In Editor should only load currently-visible levels in PIE. */
UPROPERTY(config)
uint32 bOnlyLoadVisibleLevelsInPIE:1;
UPROPERTY(config, EditAnywhere, Category = PlayInEditor, meta = (DisplayName="Stream Sub-Levels during Play in Editor", ToolTip="Prefer to stream sub-levels from the disk instead of duplicating editor sub-levels"))
uint32 bPreferToStreamLevelsInPIE:1;
/** Should warnings and errors in the Output Log during "Play in Editor" be promoted to the message log? */
UPROPERTY(EditAnywhere, config, Category = PlayInEditor)
#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/Settings/SettingsClasses.cpp:549
Scope (from outer to inner):
file
function void ULevelEditorPlaySettings::PostEditChangeProperty
Source code excerpt:
}
if (PropertyChangedEvent.Property && PropertyChangedEvent.Property->GetFName() == GET_MEMBER_NAME_CHECKED(ULevelEditorPlaySettings, bOnlyLoadVisibleLevelsInPIE))
{
for (TObjectIterator<UWorld> WorldIt; WorldIt; ++WorldIt)
{
WorldIt->PopulateStreamingLevelsToConsider();
}
}
#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/UnrealEdEngine.cpp:971
Scope (from outer to inner):
file
function bool UUnrealEdEngine::OnlyLoadEditorVisibleLevelsInPIE
Source code excerpt:
bool UUnrealEdEngine::OnlyLoadEditorVisibleLevelsInPIE() const
{
return GetDefault<ULevelEditorPlaySettings>()->bOnlyLoadVisibleLevelsInPIE;
}
bool UUnrealEdEngine::PreferToStreamLevelsInPIE() const
{
return GetDefault<ULevelEditorPlaySettings>()->bPreferToStreamLevelsInPIE;
}