geometry.DynamicMesh.EnableDebugMeshes
geometry.DynamicMesh.EnableDebugMeshes
#Overview
name: geometry.DynamicMesh.EnableDebugMeshes
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Enable/Disable FDynamicMesh3 Global Debug Mesh support. Debug Mesh support is only available in the Editor.
It is referenced in 5
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of geometry.DynamicMesh.EnableDebugMeshes
is to enable or disable the FDynamicMesh3 Global Debug Mesh support in Unreal Engine 5. This setting is specifically for debugging purposes in the geometry system, particularly for dynamic meshes.
This setting variable is primarily used in the GeometryCore module of Unreal Engine 5, specifically within the DynamicMesh subsystem. It’s part of the debugging infrastructure for the geometry system.
The value of this variable is set through a console variable (CVar) system. It’s defined as a TAutoConsoleVariable<bool>
with a default value of false, meaning it’s disabled by default.
The associated variable CVarDynamicMeshDebugMeshesEnabled
directly interacts with this setting. They share the same value and are used interchangeably in the code.
Developers must be aware of several important points when using this variable:
- This debug feature is only available in the Editor, not in runtime builds.
- When disabled, attempts to use debug mesh functions will result in warning messages in the log.
- Enabling this variable allows for storing, retrieving, and clearing debug meshes.
Best practices for using this variable include:
- Only enable it when actively debugging geometry issues, as it may have performance implications.
- Use it in conjunction with the
geometry.DynamicMesh.ClearDebugMeshes
console command to manage debug meshes. - Be aware that this setting affects global behavior, so it should be used cautiously in multi-user development environments.
Regarding the associated variable CVarDynamicMeshDebugMeshesEnabled
:
- Its purpose is identical to
geometry.DynamicMesh.EnableDebugMeshes
. - It’s used directly in the C++ code to check if debug mesh operations are allowed.
- It’s queried using the
GetValueOnAnyThread()
method, suggesting it’s designed for thread-safe access. - This variable is used as a gate for debug mesh operations like clearing, stashing, and fetching debug meshes.
When working with CVarDynamicMeshDebugMeshesEnabled
, developers should:
- Use it to conditionally execute debug-related code.
- Be aware that it affects the behavior of functions like
ClearAllDebugMeshes()
,StashDebugMesh()
, andFetchDebugMesh()
. - Consider wrapping debug mesh operations in preprocessor conditions (like
#if WITH_EDITOR
) to ensure they’re not compiled into non-editor builds.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/GeometryCore/Private/DynamicMesh/DynamicMesh3.cpp:1350
Scope: file
Source code excerpt:
static TAutoConsoleVariable<bool> CVarDynamicMeshDebugMeshesEnabled(
TEXT("geometry.DynamicMesh.EnableDebugMeshes"),
false,
TEXT("Enable/Disable FDynamicMesh3 Global Debug Mesh support. Debug Mesh support is only available in the Editor."));
static FAutoConsoleCommand DynamicMeshClearDebugMeshesCmd(
TEXT("geometry.DynamicMesh.ClearDebugMeshes"),
TEXT("Discard all debug meshes currently stored in the FDynamicMesh3 Global Debug Mesh set. This command only works in the Editor."),
#Associated Variable and Callsites
This variable is associated with another variable named CVarDynamicMeshDebugMeshesEnabled
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/GeometryCore/Private/DynamicMesh/DynamicMesh3.cpp:1349
Scope: file
Source code excerpt:
static TAutoConsoleVariable<bool> CVarDynamicMeshDebugMeshesEnabled(
TEXT("geometry.DynamicMesh.EnableDebugMeshes"),
false,
TEXT("Enable/Disable FDynamicMesh3 Global Debug Mesh support. Debug Mesh support is only available in the Editor."));
static FAutoConsoleCommand DynamicMeshClearDebugMeshesCmd(
TEXT("geometry.DynamicMesh.ClearDebugMeshes"),
#Loc: <Workspace>/Engine/Source/Runtime/GeometryCore/Private/DynamicMesh/DynamicMesh3.cpp:1370
Scope (from outer to inner):
file
function void UE::Geometry::Debug::ClearAllDebugMeshes
Source code excerpt:
{
#if WITH_EDITOR
if (CVarDynamicMeshDebugMeshesEnabled.GetValueOnAnyThread() == false )
{
UE_LOG(LogGeometry, Warning, TEXT("ClearAllDebugMeshes() called but geometry.DynamicMesh.EnableDebugMeshes CVar is disabled"));
return;
}
UELocal::GlobalDebugMeshes.Reset();
#Loc: <Workspace>/Engine/Source/Runtime/GeometryCore/Private/DynamicMesh/DynamicMesh3.cpp:1385
Scope (from outer to inner):
file
function void UE::Geometry::Debug::StashDebugMesh
Source code excerpt:
{
#if WITH_EDITOR
if (CVarDynamicMeshDebugMeshesEnabled.GetValueOnAnyThread() == false )
{
UE_LOG(LogGeometry, Warning, TEXT("StashDebugMesh() called but geometry.DynamicMesh.EnableDebugMeshes CVar is disabled"))
return;
}
UELocal::GlobalDebugMeshes.Add( DebugMeshName, MakeUnique<FDynamicMesh3>(Mesh) );
#Loc: <Workspace>/Engine/Source/Runtime/GeometryCore/Private/DynamicMesh/DynamicMesh3.cpp:1400
Scope (from outer to inner):
file
function bool UE::Geometry::Debug::FetchDebugMesh
Source code excerpt:
{
#if WITH_EDITOR
if (CVarDynamicMeshDebugMeshesEnabled.GetValueOnAnyThread() == false )
{
UE_LOG(LogGeometry, Warning, TEXT("FetchDebugMesh() called but geometry.DynamicMesh.EnableDebugMeshes CVar is disabled"));
return false;
}
TUniquePtr<FDynamicMesh3>* FoundMesh = UELocal::GlobalDebugMeshes.Find(DebugMeshName);