ShowFlag.VREditing
ShowFlag.VREditing
#Overview
name: ShowFlag.VREditing
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Allows to override a specific showflag (works in editor and game, \
It is referenced in 5
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of ShowFlag.VREditing is to indicate whether the current viewport is in VR editing mode. This setting variable is primarily used in the Unreal Engine’s editor and rendering systems.
Based on the callsites, this variable is primarily used in the UnrealEd module, specifically in the EditorViewportClient class, and in the Engine module’s LegacyScreenPercentageDriver.
The value of this variable is set within the engine’s show flags system, as evidenced by its declaration in the ShowFlagsValues.inl file. It’s defined as a fixed show flag that is not accessible in shipping builds.
ShowFlag.VREditing interacts with other variables, particularly EngineShowFlags.StereoRendering. These are often used together to determine the view status for screen percentage calculations and to control certain rendering behaviors.
Developers should be aware that this variable is specifically for editor use and is not available in shipping builds. It’s used to adjust viewport behavior and rendering settings when in VR editing mode.
Best practices when using this variable include:
- Only use it in editor-specific code.
- Consider its interaction with other show flags, particularly StereoRendering.
- Be aware that it affects screen percentage calculations and may impact performance.
Regarding the associated variable VREditing:
The purpose of VREditing is the same as ShowFlag.VREditing, as they share the same value. It’s used in the context of EngineShowFlags to indicate VR editing mode.
This variable is used in the UnrealEd module, specifically in the EditorViewportClient class. It’s used to toggle between VR editing and normal editing modes, and to store the state of show flags for each mode.
The value of VREditing is set and toggled within the EditorViewportClient class, particularly in the SetVREditView function.
VREditing interacts closely with other EngineShowFlags variables, and is used to switch between different sets of show flags for VR and non-VR editing.
Developers should be aware that this variable is used to manage the transition between VR and non-VR editing modes, affecting the entire set of engine show flags.
Best practices include:
- Use this variable in conjunction with other EngineShowFlags when managing editor viewport states.
- Ensure proper state management when switching between VR and non-VR editing modes.
- Be mindful of its impact on rendering and viewport behavior in the editor.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Public/ShowFlagsValues.inl:385
Scope: file
Source code excerpt:
SHOWFLAG_ALWAYS_ACCESSIBLE(MediaPlanes, SFG_Normal, NSLOCTEXT("UnrealEd", "MediaPlanesSF", "Media Planes"))
/** if this is a vr editing viewport, needed? */
SHOWFLAG_FIXED_IN_SHIPPING(0, VREditing, SFG_Hidden, NSLOCTEXT("UnrealEd", "VREditSF", "VR Editing"))
/** Visualize Occlusion Query bounding meshes */
SHOWFLAG_FIXED_IN_SHIPPING(0, OcclusionMeshes, SFG_Visualize, NSLOCTEXT("UnrealEd", "VisualizeOcclusionQueries", "Visualize Occlusion Queries"))
/** Visualize Occlusion Query bounding meshes */
SHOWFLAG_FIXED_IN_SHIPPING(0, VisualizeInstanceOcclusionQueries, SFG_Visualize, NSLOCTEXT("UnrealEd", "VisualizeInstanceOcclusionQueriesSF", "Visualize Instance Culling Occlusion Queries"))
/** Disable hardware occlusion queries, similar to setting r.AllowOcclusionQueries=0, but just for this scene. */
SHOWFLAG_FIXED_IN_SHIPPING(0, DisableOcclusionQueries, SFG_Developer, NSLOCTEXT("UnrealEd", "DisableOcclusionQueries", "Disable Hardware Occlusion Queries"))
#Associated Variable and Callsites
This variable is associated with another variable named VREditing
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/EditorViewportClient.cpp:2901
Scope (from outer to inner):
file
function EViewStatusForScreenPercentage FEditorViewportClient::GetViewStatusForScreenPercentage
Source code excerpt:
return EViewStatusForScreenPercentage::PathTracer;
}
else if (EngineShowFlags.StereoRendering || EngineShowFlags.VREditing)
{
return EViewStatusForScreenPercentage::VR;
}
else if (!bIsRealtime)
{
return EViewStatusForScreenPercentage::NonRealtime;
#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/EditorViewportClient.cpp:6410
Scope (from outer to inner):
file
function void FEditorViewportClient::SetVREditView
Source code excerpt:
{
// likely we can take the existing state
if (EngineShowFlags.VREditing)
{
VREditFlags = EngineShowFlags;
EditorFlags = LastEngineShowFlags;
}
else if (LastEngineShowFlags.VREditing)
{
VREditFlags = LastEngineShowFlags;
EditorFlags = EngineShowFlags;
}
}
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/LegacyScreenPercentageDriver.cpp:188
Scope (from outer to inner):
file
function FStaticResolutionFractionHeuristic::FStaticResolutionFractionHeuristic
Source code excerpt:
FStaticResolutionFractionHeuristic::FStaticResolutionFractionHeuristic(const FEngineShowFlags& EngineShowFlags)
{
Settings.bAllowDisplayBasedScreenPercentageMode = (EngineShowFlags.StereoRendering == 0) && (EngineShowFlags.VREditing == 0);
}
#if WITH_EDITOR
// static
bool FStaticResolutionFractionHeuristic::FUserSettings::EditorOverridePIESettings()
{
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Public/ShowFlagsValues.inl:385
Scope: file
Source code excerpt:
SHOWFLAG_ALWAYS_ACCESSIBLE(MediaPlanes, SFG_Normal, NSLOCTEXT("UnrealEd", "MediaPlanesSF", "Media Planes"))
/** if this is a vr editing viewport, needed? */
SHOWFLAG_FIXED_IN_SHIPPING(0, VREditing, SFG_Hidden, NSLOCTEXT("UnrealEd", "VREditSF", "VR Editing"))
/** Visualize Occlusion Query bounding meshes */
SHOWFLAG_FIXED_IN_SHIPPING(0, OcclusionMeshes, SFG_Visualize, NSLOCTEXT("UnrealEd", "VisualizeOcclusionQueries", "Visualize Occlusion Queries"))
/** Visualize Occlusion Query bounding meshes */
SHOWFLAG_FIXED_IN_SHIPPING(0, VisualizeInstanceOcclusionQueries, SFG_Visualize, NSLOCTEXT("UnrealEd", "VisualizeInstanceOcclusionQueriesSF", "Visualize Instance Culling Occlusion Queries"))
/** Disable hardware occlusion queries, similar to setting r.AllowOcclusionQueries=0, but just for this scene. */
SHOWFLAG_FIXED_IN_SHIPPING(0, DisableOcclusionQueries, SFG_Developer, NSLOCTEXT("UnrealEd", "DisableOcclusionQueries", "Disable Hardware Occlusion Queries"))