bEnableAutoVREditMode
bEnableAutoVREditMode
#Overview
name: bEnableAutoVREditMode
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 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of bEnableAutoVREditMode is to control the automatic entry into VR Edit Mode when a VR headset is detected and worn by the user in the Unreal Editor.
This setting variable is primarily used by the VR Editor subsystem within Unreal Engine. Specifically, it’s utilized in the VREditor module, which is responsible for managing the VR editing experience in the Unreal Engine editor.
The value of this variable is set in the VRModeSettings class, which is a UObject-derived class that stores configuration settings for the VR Editor mode. It’s defined as a config property, meaning its value can be saved and loaded from configuration files.
This variable interacts with other parts of the VR system, particularly the IHeadMountedDisplay interface and the EHMDWornState enum. It’s used in conjunction with these to determine when to automatically enter VR Edit Mode.
Developers should be aware that enabling this setting may cause the editor to automatically switch to VR mode when a headset is worn, which could be disruptive if not expected. Additionally, there’s a warning dialog associated with enabling this feature, indicating that VR mode is still experimental and may have bugs or stability issues.
Best practices when using this variable include:
- Ensure that users are aware of the implications of enabling auto VR edit mode.
- Use it in conjunction with proper error handling and user feedback mechanisms.
- Consider the performance implications of frequently checking the HMD worn state.
- Be prepared to handle cases where VR mode entry fails or causes issues.
- Provide an easy way for users to disable this feature if it becomes problematic.
#Setting Variables
#References In INI files
Location: <Workspace>/Engine/Config/BaseEditorSettings.ini:51, section: [/Script/VREditor.VRModeSettings]
- INI Section:
/Script/VREditor.VRModeSettings
- 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/VREditor/Private/VREditorModeManager.cpp:69
Scope (from outer to inner):
file
function void FVREditorModeManager::Tick
Source code excerpt:
// You can only auto-enter VR if the setting is enabled. Other criteria are that the VR Editor is enabled in experimental settings, that you are not in PIE, and that the editor is foreground.
IHeadMountedDisplay * const HMD = GEngine != nullptr && GEngine->XRSystem.IsValid() ? GEngine->XRSystem->GetHMDDevice() : nullptr;
if (GetDefault<UVRModeSettings>()->bEnableAutoVREditMode
&& HMD
&& FPlatformApplicationMisc::IsThisApplicationForeground())
{
const EHMDWornState::Type LatestHMDWornState = HMD->GetHMDWornState();
if (HMDWornState != LatestHMDWornState)
{
#Loc: <Workspace>/Engine/Source/Editor/VREditor/Private/VRModeSettings.cpp:18
Scope (from outer to inner):
file
function void UVRModeSettings::PostEditChangeProperty
Source code excerpt:
if (PropertyChangedEvent.Property
&& PropertyChangedEvent.Property->GetFName() == GET_MEMBER_NAME_CHECKED(UVRModeSettings, bEnableAutoVREditMode)
&& bEnableAutoVREditMode == true)
{
FSuppressableWarningDialog::FSetupInfo SetupInfo(LOCTEXT("VRModeEntry_Message", "VR Mode enables you to work on your project in virtual reality using motion controllers. This feature is still under development, so you may experience bugs or crashes while using it."),
LOCTEXT("VRModeEntry_Title", "Entering VR Mode - Experimental"), "Warning_VRModeEntry", GEditorSettingsIni);
SetupInfo.ConfirmText = LOCTEXT("VRModeEntry_ConfirmText", "Continue");
SetupInfo.CancelText = LOCTEXT("VRModeEntry_CancelText", "Cancel");
SetupInfo.bDefaultToSuppressInTheFuture = true;
FSuppressableWarningDialog VRModeEntryWarning(SetupInfo);
bEnableAutoVREditMode = (VRModeEntryWarning.ShowModal() != FSuppressableWarningDialog::Cancel) ? true : false;
}
}
#endif
#undef LOCTEXT_NAMESPACE
#Loc: <Workspace>/Engine/Source/Editor/VREditor/Public/VRModeSettings.h:39
Scope (from outer to inner):
file
class class UVRModeSettings : public UVISettings
Source code excerpt:
/**If true, wearing a Vive or Oculus Rift headset will automatically enter VR Editing mode */
UPROPERTY(EditAnywhere, config, Category = "General", meta = (DisplayName = "Enable VR Mode Auto-Entry"))
uint32 bEnableAutoVREditMode : 1;
// Whether or not sequences should be autokeyed
UPROPERTY(EditAnywhere, config, Category = "Cinematics")
uint32 bAutokeySequences : 1;
// Which hand should have the primary interactor laser on it