Editor.ObjectReverseLookupMask
Editor.ObjectReverseLookupMask
#Overview
name: Editor.ObjectReverseLookupMask
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
-1 - Does validation on all objects type (slowest) \n0 - Skip validation on all objects type \n1 - Perform validation on Texture to Textures lookups \n2 - Perform validation on Texture to Materials lookups \n4 - Perform validation on Material to Primitives lookups \n8 - Perform validation on StaticMesh To Components lookups \n16 - Perform validation on Material to Materials lookups \n
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of Editor.ObjectReverseLookupMask is to control the validation of object lookups in the Unreal Engine editor. It is used to determine which types of object relationships should be validated during reverse lookups.
This setting variable is primarily used by the engine’s object caching and validation system. Based on the callsites, it appears to be part of the Engine module, specifically within the object caching context.
The value of this variable is set through a console variable (CVarObjectReverseLookupMask) defined in the Engine module. It can be modified at runtime through console commands or set via command-line arguments.
The associated variable CVarObjectReverseLookupMask directly interacts with Editor.ObjectReverseLookupMask. They share the same value and purpose.
Developers must be aware that this variable uses a bitmask to control different types of validations:
- -1: Validates all object types (slowest)
- 0: Skips validation for all object types
- 1: Validates Texture to Textures lookups
- 2: Validates Texture to Materials lookups
- 4: Validates Material to Primitives lookups
Best practices when using this variable include:
- Use it judiciously, as enabling all validations (-1) can significantly impact performance.
- Consider enabling specific validations (1, 2, or 4) only when debugging related issues.
- In production or release builds, it’s generally advisable to set it to 0 to skip validations for optimal performance.
- When debugging object reference issues, use this variable to narrow down the scope of validations.
Regarding the associated variable CVarObjectReverseLookupMask:
The purpose of CVarObjectReverseLookupMask is to provide a runtime-configurable way to control the Editor.ObjectReverseLookupMask setting. It is implemented as a console variable, allowing for easy modification during development and debugging.
This variable is part of the Engine module and is used by the object caching and validation system.
The value of CVarObjectReverseLookupMask can be set through console commands, command-line arguments, or programmatically in C++ code.
It directly interacts with the Editor.ObjectReverseLookupMask setting, effectively controlling the same behavior.
Developers should be aware that changes to CVarObjectReverseLookupMask will immediately affect the object reverse lookup validation behavior. It’s important to understand the performance implications of different mask values.
Best practices for using CVarObjectReverseLookupMask include:
- Use it for debugging and profiling purposes during development.
- Document any non-default values used in specific scenarios to help other team members understand the configuration.
- Consider exposing it as a configurable option in development builds for easier testing and validation.
- Reset it to the default value (-1 or 0, depending on your project’s needs) before creating release builds.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/ObjectCacheContext.cpp:44
Scope: file
Source code excerpt:
static TAutoConsoleVariable<int32> CVarObjectReverseLookupMask(
TEXT("Editor.ObjectReverseLookupMask"),
-1,
TEXT("-1 - Does validation on all objects type (slowest) \n")
TEXT("0 - Skip validation on all objects type \n")
TEXT("1 - Perform validation on Texture to Textures lookups \n")
TEXT("2 - Perform validation on Texture to Materials lookups \n")
TEXT("4 - Perform validation on Material to Primitives lookups \n")
#Associated Variable and Callsites
This variable is associated with another variable named CVarObjectReverseLookupMask
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/ObjectCacheContext.cpp:43
Scope: file
Source code excerpt:
);
static TAutoConsoleVariable<int32> CVarObjectReverseLookupMask(
TEXT("Editor.ObjectReverseLookupMask"),
-1,
TEXT("-1 - Does validation on all objects type (slowest) \n")
TEXT("0 - Skip validation on all objects type \n")
TEXT("1 - Perform validation on Texture to Textures lookups \n")
TEXT("2 - Perform validation on Texture to Materials lookups \n")
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/ObjectCacheContext.cpp:117
Scope (from outer to inner):
file
namespace ObjectCacheContextImpl
function EObjectReverseLookupMask GetObjectReverseLookupMask
Source code excerpt:
if (FParse::Value(FCommandLine::Get(), TEXT("-ObjectReverseLookupMask="), Mask))
{
CVarObjectReverseLookupMask->Set(Mask, ECVF_SetByCommandline);
}
GIsGetObjectReverseLookupMaskInitialized = true;
}
return (EObjectReverseLookupMask)CVarObjectReverseLookupMask.GetValueOnAnyThread();
}
bool IsReverseLookupComparisonActive(EObjectReverseLookupMask Mask)
{
return GetObjectReverseLookupMode() == EObjectReverseLookupMode::Comparison && (GetObjectReverseLookupMask() & Mask) != EObjectReverseLookupMask::None;
}