Editor.ReflectEditorLevelVisibilityWithGame
Editor.ReflectEditorLevelVisibilityWithGame
#Overview
name: Editor.ReflectEditorLevelVisibilityWithGame
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Enables the transaction of game visibility state when editor visibility state changes.\n0 - game state is *not* reflected with editor.\n1 - game state is relfected with editor.\n
It is referenced in 5
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of Editor.ReflectEditorLevelVisibilityWithGame is to control whether changes in the editor’s level visibility state are reflected in the game state. This setting is primarily used in the editor’s level management system.
This setting variable is utilized by the Unreal Engine’s editor subsystem, specifically in the UnrealEd module. It’s also referenced in the ConcertSyncClient plugin and the ConsoleVariablesEditor plugin.
The value of this variable is set through a console variable (CVar) system. It’s defined as a TAutoConsoleVariable with an initial value of 0, meaning by default, game state is not reflected with editor visibility changes.
This variable interacts closely with its associated variable CVarReflectEditorLevelVisibilityWithGame. They share the same value and are used interchangeably in the code.
Developers must be aware that changing this variable will affect how level visibility changes in the editor are propagated to the game state. When set to 1, any changes to level visibility in the editor will also be applied to the game state, which could have implications for gameplay testing and level design workflows.
Best practices when using this variable include:
- Be cautious when enabling it (setting to 1) in a multiplayer context, as it could lead to inconsistencies between server and client.
- Consider the performance implications of reflecting visibility changes, especially in large or complex levels.
- Use it judiciously during development and testing phases, but consider disabling it for final builds.
Regarding the associated variable CVarReflectEditorLevelVisibilityWithGame:
The purpose of CVarReflectEditorLevelVisibilityWithGame is identical to Editor.ReflectEditorLevelVisibilityWithGame. It’s the actual console variable implementation that controls the behavior.
This variable is used directly in the UnrealEd module, specifically in the EditorLevelUtils.cpp file. It’s accessed using the GetValueOnGameThread() method to determine whether visibility changes should be reflected in the game state.
The value of this variable is set when the console variable is initialized, but can be changed at runtime through console commands.
CVarReflectEditorLevelVisibilityWithGame interacts directly with the level streaming system, influencing how visibility changes are propagated to streaming levels.
Developers should be aware that this variable is checked on the game thread, which means changes to it will take effect in the next frame or tick.
Best practices for using CVarReflectEditorLevelVisibilityWithGame include:
- Use it in conjunction with other level streaming and visibility systems for consistent behavior.
- Be mindful of its performance impact, especially when frequently changing level visibility.
- Consider exposing it as a configurable option in editor settings for easier access by level designers and developers.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/EditorLevelUtils.cpp:62
Scope: file
Source code excerpt:
static TAutoConsoleVariable<int32> CVarReflectEditorLevelVisibilityWithGame(
TEXT("Editor.ReflectEditorLevelVisibilityWithGame"),
0,
TEXT("Enables the transaction of game visibility state when editor visibility state changes.\n")
TEXT("0 - game state is *not* reflected with editor.\n")
TEXT("1 - game state is relfected with editor.\n"), ECVF_Default);
UEditorLevelUtils::FCanMoveActorToLevelDelegate UEditorLevelUtils::CanMoveActorToLevelDelegate;
#Loc: <Workspace>/Engine/Plugins/Developer/Concert/ConcertSync/ConcertSyncClient/Source/ConcertSyncClient/Private/ConcertClientWorkspace.cpp:182
Scope (from outer to inner):
file
namespace UE::ConcertWorkspace::Private
Source code excerpt:
};
static FCVarBool<TEXT("Editor.ReflectEditorLevelVisibilityWithGame"), true /*Editor Only*/> ReflectVisInGame;
static FCVarBool<TEXT("LevelInstance.ForceEditorWorldMode"), false /*Editor Only*/> LevelInstanceForceEditorWorldMode;
static FCVarBool<TEXT("EditorPaths.Enabled"), false /*Editor Only*/> EditorPaths;
}
struct FConcertWorkspaceConsoleCommands
{
#Loc: <Workspace>/Engine/Plugins/Editor/ConsoleVariablesEditor/Source/ConsoleVariablesEditor/Public/ConsoleVariablesEditorProjectSettings.h:25
Scope (from outer to inner):
file
class class UConsoleVariablesEditorProjectSettings : public UObject
function UConsoleVariablesEditorProjectSettings
Source code excerpt:
ChangedConsoleVariableSkipList =
{
"Editor.ReflectEditorLevelVisibilityWithGame"
};
}
/**
*When a row is unchecked, its associated variable's value will be set to the value recorded when the plugin was loaded.
*The value displayed to the user can be configured with this setting, but will not affect the actual applied value.
#Associated Variable and Callsites
This variable is associated with another variable named CVarReflectEditorLevelVisibilityWithGame
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/EditorLevelUtils.cpp:61
Scope: file
Source code excerpt:
#define LOCTEXT_NAMESPACE "EditorLevelUtils"
static TAutoConsoleVariable<int32> CVarReflectEditorLevelVisibilityWithGame(
TEXT("Editor.ReflectEditorLevelVisibilityWithGame"),
0,
TEXT("Enables the transaction of game visibility state when editor visibility state changes.\n")
TEXT("0 - game state is *not* reflected with editor.\n")
TEXT("1 - game state is relfected with editor.\n"), ECVF_Default);
#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/EditorLevelUtils.cpp:1225
Scope (from outer to inner):
file
function void SetLevelVisibilityNoGlobalUpdateInternal
Source code excerpt:
else
{
const bool bReflectVisibilityToGame = CVarReflectEditorLevelVisibilityWithGame.GetValueOnGameThread() != 0;
ULevelStreaming* StreamingLevel = NULL;
if (Level->OwningWorld == NULL || Level->OwningWorld->PersistentLevel != Level)
{
StreamingLevel = FLevelUtils::FindStreamingLevel(Level);
}