wp.Editor.DisableLevelInstanceEditorPartialLoading

wp.Editor.DisableLevelInstanceEditorPartialLoading

#Overview

name: wp.Editor.DisableLevelInstanceEditorPartialLoading

This variable is created as a Console Variable (cvar).

It is referenced in 3 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of wp.Editor.DisableLevelInstanceEditorPartialLoading is to control the partial loading of level instances in the Unreal Engine editor. It allows developers to disable this feature when needed.

This setting variable is primarily used in the Level Streaming system of Unreal Engine, specifically for Level Instances. It’s part of the Engine module, as evident from its location in the Engine/Source/Runtime/Engine directory.

The value of this variable is set through a console variable (cvar) system. It’s initialized as false and can be changed at runtime using console commands or through engine configuration files.

The associated variable GDisableLevelInstanceEditorPartialLoading directly interacts with wp.Editor.DisableLevelInstanceEditorPartialLoading. They share the same value, with the console variable acting as an interface to modify the global variable.

Developers must be aware that this variable affects the editor’s behavior regarding level instance loading. When set to true, it disables partial loading of level instances in the editor, which could impact performance and memory usage.

Best practices when using this variable include:

  1. Use it judiciously, as disabling partial loading might increase memory usage and load times.
  2. Consider performance implications when enabling or disabling this feature.
  3. Use it for debugging or specific development scenarios where full loading of level instances is necessary.

Regarding the associated variable GDisableLevelInstanceEditorPartialLoading:

The purpose of GDisableLevelInstanceEditorPartialLoading is to store the state of whether partial loading of level instances in the editor is disabled.

This variable is used within the Engine module, specifically in the Level Streaming system for Level Instances.

Its value is set through the associated console variable wp.Editor.DisableLevelInstanceEditorPartialLoading.

It directly interacts with the WorldPartition system, specifically affecting the bOverrideEnableStreamingInEditor flag of the outer world partition.

Developers should be aware that this variable directly impacts the behavior of level instance loading in the editor. When true, it forces full loading of level instances, which could affect performance.

Best practices for using this variable include:

  1. Use it in conjunction with the console variable for consistency.
  2. Be mindful of its impact on editor performance and memory usage.
  3. Consider resetting it to false after debugging or specific development tasks that required full loading.

#References in C++ code

#Callsites

This variable is referenced in the following C++ source code:

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/LevelInstance/LevelInstanceLevelStreaming.cpp:31

Scope: file

Source code excerpt:

static bool GDisableLevelInstanceEditorPartialLoading = false;
FAutoConsoleVariableRef CVarDisableLevelInstanceEditorPartialLoading(
	TEXT("wp.Editor.DisableLevelInstanceEditorPartialLoading"),
	GDisableLevelInstanceEditorPartialLoading,
	TEXT("Allow disabling partial loading of level instances in the editor."),
	ECVF_Default);

static bool GForceEditorWorldMode = false;
FAutoConsoleVariableRef CVarForceEditorWorldMode(

#Associated Variable and Callsites

This variable is associated with another variable named GDisableLevelInstanceEditorPartialLoading. They share the same value. See the following C++ source code.

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/LevelInstance/LevelInstanceLevelStreaming.cpp:29

Scope: file

Source code excerpt:

#include "Streaming/LevelStreamingDelegates.h"

static bool GDisableLevelInstanceEditorPartialLoading = false;
FAutoConsoleVariableRef CVarDisableLevelInstanceEditorPartialLoading(
	TEXT("wp.Editor.DisableLevelInstanceEditorPartialLoading"),
	GDisableLevelInstanceEditorPartialLoading,
	TEXT("Allow disabling partial loading of level instances in the editor."),
	ECVF_Default);

static bool GForceEditorWorldMode = false;
FAutoConsoleVariableRef CVarForceEditorWorldMode(
	TEXT("LevelInstance.ForceEditorWorldMode"),

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/LevelInstance/LevelInstanceLevelStreaming.cpp:449

Scope (from outer to inner):

file
function     void ULevelStreamingLevelInstance::OnLevelLoadedChanged

Source code excerpt:

				if (UWorldPartition* OwningWorldPartition = GetWorld()->GetWorldPartition(); OwningWorldPartition && OwningWorldPartition->IsStreamingEnabled())
				{
					if (GDisableLevelInstanceEditorPartialLoading)
					{
						OuterWorldPartition->bOverrideEnableStreamingInEditor = false;
					}
					else if (ILevelInstanceInterface* LevelInstance = LevelInstanceSubsystem->GetLevelInstance(LevelInstanceID))
					{
						OuterWorldPartition->bOverrideEnableStreamingInEditor = LevelInstance->SupportsPartialEditorLoading();