r.Editor.HideLightStaticMobilityWhenStaticLightingDisabled
r.Editor.HideLightStaticMobilityWhenStaticLightingDisabled
#Overview
name: r.Editor.HideLightStaticMobilityWhenStaticLightingDisabled
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Hide Static mobility on Light components when project has Static Lighting disabled.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.Editor.HideLightStaticMobilityWhenStaticLightingDisabled is to control the visibility of the Static mobility option for Light components in the Unreal Engine editor when static lighting is disabled in the project.
This setting variable is primarily used in the Editor subsystem, specifically within the DetailCustomizations module. It affects the user interface for configuring Light component mobility in the editor.
The value of this variable is set through a console variable (CVar) named CVarHideLightStaticMobilityWhenStaticLightingDisabled. It is initialized with a default value of false, meaning that by default, the Static mobility option for Light components is not hidden even when static lighting is disabled.
The associated variable CVarHideLightStaticMobilityWhenStaticLightingDisabled directly interacts with this setting. It is defined as a TAutoConsoleVariable
Developers must be aware that this variable affects the editor UI and can potentially hide important configuration options for Light components. It’s crucial to understand that this setting doesn’t change the underlying functionality of static lighting or Light components; it only affects their visibility in the editor interface.
Best practices when using this variable include:
- Carefully consider whether hiding the Static mobility option is appropriate for your project’s workflow.
- Communicate any changes to this setting to all team members to avoid confusion when working with Light components.
- Remember that this setting is specific to the editor and doesn’t affect runtime behavior of the game.
Regarding the associated variable CVarHideLightStaticMobilityWhenStaticLightingDisabled:
The purpose of CVarHideLightStaticMobilityWhenStaticLightingDisabled is to provide a runtime-configurable way to control the behavior defined by r.Editor.HideLightStaticMobilityWhenStaticLightingDisabled.
This console variable is used in the Editor subsystem, specifically within the MobilityCustomization class in the DetailCustomizations module.
The value of this variable is set when it’s declared, with an initial value of false. It can be changed at runtime through console commands or configuration files.
This variable directly controls the behavior of hiding the Static mobility option for Light components. It’s used in the GenerateHeaderRowContent function of the FMobilityCustomization class to determine whether to show the Static mobility option.
Developers should be aware that changes to this variable will immediately affect the editor UI for Light components. It’s important to understand that this doesn’t change the underlying functionality of Light components or static lighting; it only affects what options are visible in the editor.
Best practices for using this variable include:
- Use it in conjunction with other lighting-related settings to create a consistent editor experience.
- Consider exposing this option in your project’s settings UI if it’s frequently adjusted.
- Document any custom default values or usage of this variable in your project to ensure all team members understand its impact on the editor UI.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Editor/DetailCustomizations/Private/MobilityCustomization.cpp:24
Scope: file
Source code excerpt:
TAutoConsoleVariable<bool> CVarHideLightStaticMobilityWhenStaticLightingDisabled(
TEXT("r.Editor.HideLightStaticMobilityWhenStaticLightingDisabled"),
false,
TEXT("Hide Static mobility on Light components when project has Static Lighting disabled."),
ECVF_RenderThreadSafe);
#define LOCTEXT_NAMESPACE "MobilityCustomization"
#Associated Variable and Callsites
This variable is associated with another variable named CVarHideLightStaticMobilityWhenStaticLightingDisabled
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Editor/DetailCustomizations/Private/MobilityCustomization.cpp:23
Scope: file
Source code excerpt:
#include "Widgets/Text/STextBlock.h"
TAutoConsoleVariable<bool> CVarHideLightStaticMobilityWhenStaticLightingDisabled(
TEXT("r.Editor.HideLightStaticMobilityWhenStaticLightingDisabled"),
false,
TEXT("Hide Static mobility on Light components when project has Static Lighting disabled."),
ECVF_RenderThreadSafe);
#define LOCTEXT_NAMESPACE "MobilityCustomization"
#Loc: <Workspace>/Engine/Source/Editor/DetailCustomizations/Private/MobilityCustomization.cpp:75
Scope (from outer to inner):
file
function void FMobilityCustomization::GenerateHeaderRowContent
Source code excerpt:
const bool bAllowStaticLighting = IsStaticLightingAllowed();
if (bForLight && CVarHideLightStaticMobilityWhenStaticLightingDisabled.GetValueOnGameThread())
{
bShowStatic &= bAllowStaticLighting;
}
int32 ColumnIndex = 0;