DumpCopyPropertiesForUnrelatedObjects
DumpCopyPropertiesForUnrelatedObjects
#Overview
name: DumpCopyPropertiesForUnrelatedObjects
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Dump the objects that are cross class copied
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of DumpCopyPropertiesForUnrelatedObjects is to enable debugging and logging of cross-class object copying operations in Unreal Engine 5. This setting is primarily used for diagnostics and development purposes within the Engine’s core functionality.
This setting variable is primarily used in the Engine module, specifically in the object copying and property management system. It is referenced in the UnrealEngine.cpp file, which is a core part of the Engine’s runtime.
The value of this variable is set through a console variable (CVar) system. It is initialized with a default value of 0, meaning it’s disabled by default. Developers can change this value at runtime using console commands or through configuration files.
The associated variable CVarDumpCopyPropertiesForUnrelatedObjects directly interacts with DumpCopyPropertiesForUnrelatedObjects. They share the same value and purpose.
Developers must be aware that enabling this variable (setting it to a non-zero value) will cause the engine to dump detailed information about objects being copied across different classes. This can have performance implications and generate a large amount of debug output, so it should be used judiciously, primarily for debugging purposes.
Best practices when using this variable include:
- Only enable it when actively debugging cross-class object copying issues.
- Be prepared for potentially large amounts of debug output when enabled.
- Remember to disable it after debugging to avoid unnecessary performance overhead in production builds.
- Use in conjunction with other debugging tools and logs for a comprehensive understanding of object copying behavior.
Regarding the associated variable CVarDumpCopyPropertiesForUnrelatedObjects:
The purpose of CVarDumpCopyPropertiesForUnrelatedObjects is to provide a runtime-configurable way to control the DumpCopyPropertiesForUnrelatedObjects functionality. It’s an instance of TAutoConsoleVariable, which is Unreal Engine’s mechanism for creating console variables.
This variable is used in the same Engine module and UnrealEngine.cpp file. Its value is typically set through console commands or configuration files, allowing developers to toggle the dumping functionality at runtime or during engine initialization.
The value of CVarDumpCopyPropertiesForUnrelatedObjects is checked in the UEngine::CopyPropertiesForUnrelatedObjects function to determine whether to dump object properties during cross-class copying operations.
Developers should be aware that this variable provides immediate control over the dumping functionality. Changing its value will immediately affect the engine’s behavior regarding property dumping for unrelated objects.
Best practices for using CVarDumpCopyPropertiesForUnrelatedObjects include:
- Use console commands to toggle this functionality on and off during runtime for dynamic debugging.
- Consider setting it in configuration files for consistent behavior across debug sessions.
- Be cautious about enabling it in shipping builds, as it’s primarily intended for development and debugging scenarios.
- When enabled, be prepared to handle and analyze the additional debug output it generates.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/UnrealEngine.cpp:16855
Scope: file
Source code excerpt:
static TAutoConsoleVariable<int32> CVarDumpCopyPropertiesForUnrelatedObjects(
TEXT("DumpCopyPropertiesForUnrelatedObjects"),
0,
TEXT("Dump the objects that are cross class copied")
);
/*
* Houses base functionality shared between CPFUO archivers (FCPFUOWriter/FCPFUOReader)
#Associated Variable and Callsites
This variable is associated with another variable named CVarDumpCopyPropertiesForUnrelatedObjects
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/UnrealEngine.cpp:16854
Scope: file
Source code excerpt:
};
static TAutoConsoleVariable<int32> CVarDumpCopyPropertiesForUnrelatedObjects(
TEXT("DumpCopyPropertiesForUnrelatedObjects"),
0,
TEXT("Dump the objects that are cross class copied")
);
/*
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/UnrealEngine.cpp:17459
Scope (from outer to inner):
file
function void UEngine::CopyPropertiesForUnrelatedObjects
Source code excerpt:
}
bool bDumpProperties = CVarDumpCopyPropertiesForUnrelatedObjects.GetValueOnAnyThread() != 0;
// Uncomment the next line to debug CPFUO for a specific object:
// bDumpProperties |= (NewObject->GetName().Find(TEXT("SpinTree")) != INDEX_NONE);
if (bDumpProperties)
{
DumpObject(*FString::Printf(TEXT("CopyPropertiesForUnrelatedObjects: Old (%s)"), *OldObject->GetFullName()), OldObject);
DumpObject(*FString::Printf(TEXT("CopyPropertiesForUnrelatedObjects: New (%s)"), *NewObject->GetFullName()), NewObject);