ShowFlag.VisualizeLevelInstanceEditing

ShowFlag.VisualizeLevelInstanceEditing

#Overview

name: ShowFlag.VisualizeLevelInstanceEditing

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 ShowFlag.VisualizeLevelInstanceEditing is to control the visualization of Level Instance editing in the Unreal Engine editor. It is used to grey out actors that do not belong to the currently edited Level Instance.

This setting variable is primarily used in the rendering system, specifically in the post-processing pipeline. It is part of the Unreal Engine’s editor visualization features.

Based on the callsites, this variable is utilized in the Renderer module, particularly in the post-processing passes. It’s defined in the Engine module’s public header, indicating it’s a core engine feature accessible to other modules.

The value of this variable is set using the SHOWFLAG_FIXED_IN_SHIPPING macro, which suggests that it’s a debug or editor-only feature that is not available in shipping builds. The initial value is set to 0, meaning it’s disabled by default.

This variable interacts closely with another show flag, EditingLevelInstance. They are used together to determine whether to enable a specific post-processing pass for visualizing Level Instance editing.

Developers should be aware that this variable is only relevant in the editor context and won’t have any effect in shipping builds. It’s specifically designed for level editing workflows involving Level Instances.

Best practices when using this variable include:

  1. Only enable it when actively editing Level Instances to avoid unnecessary performance overhead.
  2. Use it in conjunction with the EditingLevelInstance flag for proper functionality.
  3. Be aware that it may affect the visual representation of actors in the editor viewport.

Regarding the associated variable VisualizeLevelInstanceEditing:

The purpose of VisualizeLevelInstanceEditing is identical to ShowFlag.VisualizeLevelInstanceEditing. It’s defined in the same location and serves the same function.

This variable is used directly in the post-processing pipeline to determine whether to enable the VisualizeLevelInstance pass. It’s checked alongside the EditingLevelInstance flag and other conditions to decide if the pass should be executed.

The value of this variable is set in the same way as ShowFlag.VisualizeLevelInstanceEditing, using the SHOWFLAG_FIXED_IN_SHIPPING macro.

It interacts with the EditingLevelInstance flag and is part of the EngineShowFlags structure, which suggests it can be toggled through the engine’s show flags system.

Developers should be aware that this variable is only effective in the editor and when GIsEditor is true. It’s also important to note that it won’t have any effect if HDR visualization is active.

Best practices for using this variable include:

  1. Use it in editor tools and plugins related to Level Instance editing.
  2. Ensure it’s properly toggled when switching between different editing modes or views.
  3. Be mindful of its performance impact, as it may require additional rendering passes when enabled.

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Public/ShowFlagsValues.inl:251

Scope: file

Source code excerpt:

SHOWFLAG_FIXED_IN_SHIPPING(0, Selection, SFG_Advanced, NSLOCTEXT("UnrealEd", "SelectionSF", "Selection"))
/** Grey out actors which do not belong to the currently edited LevelInstance */
SHOWFLAG_FIXED_IN_SHIPPING(0, VisualizeLevelInstanceEditing, SFG_Visualize, NSLOCTEXT("UnrealEd", "VisualizeLevelInstanceEditingSF", "Visualize Level Instance Editing"))
/** Used to determine whether there are any editing LevelInstances to enable the post processing pass */
SHOWFLAG_FIXED_IN_SHIPPING(0, EditingLevelInstance, SFG_Transient, NSLOCTEXT("UnrealEd", "EditingLevelInstanceSF", "Editing LevelInstance"))
/** Draws mode specific widgets and controls in the viewports (should only be set on viewport clients that are editing the level itself) */
SHOWFLAG_FIXED_IN_SHIPPING(0, ModeWidgets, SFG_Advanced, NSLOCTEXT("UnrealEd", "ModeWidgetsSF", "Mode Widgets"))
/**  */
SHOWFLAG_FIXED_IN_SHIPPING(0, Bounds,  SFG_Advanced, NSLOCTEXT("UnrealEd", "BoundsSF", "Bounds"))

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Public/ShowFlagsValues.inl:251

Scope: file

Source code excerpt:

SHOWFLAG_FIXED_IN_SHIPPING(0, Selection, SFG_Advanced, NSLOCTEXT("UnrealEd", "SelectionSF", "Selection"))
/** Grey out actors which do not belong to the currently edited LevelInstance */
SHOWFLAG_FIXED_IN_SHIPPING(0, VisualizeLevelInstanceEditing, SFG_Visualize, NSLOCTEXT("UnrealEd", "VisualizeLevelInstanceEditingSF", "Visualize Level Instance Editing"))
/** Used to determine whether there are any editing LevelInstances to enable the post processing pass */
SHOWFLAG_FIXED_IN_SHIPPING(0, EditingLevelInstance, SFG_Transient, NSLOCTEXT("UnrealEd", "EditingLevelInstanceSF", "Editing LevelInstance"))
/** Draws mode specific widgets and controls in the viewports (should only be set on viewport clients that are editing the level itself) */
SHOWFLAG_FIXED_IN_SHIPPING(0, ModeWidgets, SFG_Advanced, NSLOCTEXT("UnrealEd", "ModeWidgetsSF", "Mode Widgets"))
/**  */
SHOWFLAG_FIXED_IN_SHIPPING(0, Bounds,  SFG_Advanced, NSLOCTEXT("UnrealEd", "BoundsSF", "Bounds"))

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PostProcess/PostProcessing.cpp:472

Scope (from outer to inner):

file
function     void AddPostProcessingPasses

Source code excerpt:

	PassSequence.SetEnabled(EPass::VisualizeSkyLightIlluminanceMeter, Scene&& Scene->SkyLight && View.Family && View.Family->EngineShowFlags.VisualizeSkyLightIlluminance);
	PassSequence.SetEnabled(EPass::VisualizeLightFunctionAtlas, Scene && Scene->LightFunctionAtlasSceneData.GetLightFunctionAtlasEnabled() && View.Family && View.Family->EngineShowFlags.VisualizeLightFunctionAtlas);
	PassSequence.SetEnabled(EPass::VisualizeLevelInstance, GIsEditor && EngineShowFlags.EditingLevelInstance && EngineShowFlags.VisualizeLevelInstanceEditing && !bVisualizeHDR);
	PassSequence.SetEnabled(EPass::SelectionOutline, GIsEditor && EngineShowFlags.Selection && EngineShowFlags.SelectionOutline && !EngineShowFlags.Wireframe && !bVisualizeHDR);
	PassSequence.SetEnabled(EPass::EditorPrimitive, FSceneRenderer::ShouldCompositeEditorPrimitives(View));
#else
	PassSequence.SetEnabled(EPass::VisualizeSkyAtmosphere, false);
	PassSequence.SetEnabled(EPass::VisualizeSkyLightIlluminanceMeter, false);
	PassSequence.SetEnabled(EPass::VisualizeLightFunctionAtlas, false);