Serialization.AllowSidecarSyncing

Serialization.AllowSidecarSyncing

#Overview

name: Serialization.AllowSidecarSyncing

This variable is created as a Console Variable (cvar).

It is referenced in 3 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of Serialization.AllowSidecarSyncing is to control whether FEditorBulkData should attempt to sync its .upayload file via source control if the first attempt to load from it fails. This setting is primarily related to the serialization system in Unreal Engine 5, specifically for handling bulk data in editor scenarios.

This setting variable is mainly used in the CoreUObject module, specifically within the UE::Serialization namespace. It’s primarily utilized in the EditorBulkData.cpp file, which handles the serialization of large data assets in the Unreal Editor.

The value of this variable is set through a console variable (CVar) system. It’s defined as a static TAutoConsoleVariable with a default value of false. This means that by default, the engine will not attempt to sync the .upayload file via source control if the initial load fails.

The associated variable CVarShouldAllowSidecarSyncing directly interacts with Serialization.AllowSidecarSyncing. They share the same value and purpose.

Developers should be aware that enabling this setting can impact performance and network usage, as it may trigger source control operations when bulk data fails to load initially. It’s important to consider the implications on collaborative workflows and version control systems when enabling this feature.

Best practices when using this variable include:

  1. Keep it disabled by default to avoid unnecessary source control operations.
  2. Enable it only when working in environments where synchronizing bulk data from source control is necessary and beneficial.
  3. Ensure that your source control system is properly configured to handle large binary files when enabling this feature.
  4. Monitor performance and source control usage when this feature is enabled, as it may impact load times and network traffic.

Regarding the associated variable CVarShouldAllowSidecarSyncing:

The purpose of CVarShouldAllowSidecarSyncing is identical to Serialization.AllowSidecarSyncing. It’s the actual console variable that controls the behavior described above.

This variable is used in the same CoreUObject module, specifically in the FEditorBulkData::LoadFromSidecarFile function. When enabled, it allows the function to attempt syncing the .upayload file from source control if the initial load fails.

The value of CVarShouldAllowSidecarSyncing is set through the console variable system and can be changed at runtime.

Developers should be aware that this variable directly controls the behavior of bulk data loading in editor scenarios. Changing its value can significantly impact how the engine handles large asset files, especially in collaborative environments.

Best practices for using CVarShouldAllowSidecarSyncing are the same as those for Serialization.AllowSidecarSyncing, as they are essentially the same setting exposed through different interfaces.

#References in C++ code

#Callsites

This variable is referenced in the following C++ source code:

#Loc: <Workspace>/Engine/Source/Runtime/CoreUObject/Private/Serialization/EditorBulkData.cpp:64

Scope (from outer to inner):

file
namespace    UE::Serialization

Source code excerpt:


static TAutoConsoleVariable<bool> CVarShouldAllowSidecarSyncing(
	TEXT("Serialization.AllowSidecarSyncing"),
	false,
	TEXT("When true FEditorBulkData will attempt to sync it's .upayload file via sourcecontrol if the first attempt to load from it fails"));

/** When enabled the bulkdata object will try pushing the payload when saved to disk as part of a package.
  * This is legacy behavior and likely to be removed
  */

#Associated Variable and Callsites

This variable is associated with another variable named CVarShouldAllowSidecarSyncing. They share the same value. See the following C++ source code.

#Loc: <Workspace>/Engine/Source/Runtime/CoreUObject/Private/Serialization/EditorBulkData.cpp:63

Scope (from outer to inner):

file
namespace    UE::Serialization

Source code excerpt:

	TEXT("When true FEditorBulkData will load payloads via the package trailer rather than the package itself"));

static TAutoConsoleVariable<bool> CVarShouldAllowSidecarSyncing(
	TEXT("Serialization.AllowSidecarSyncing"),
	false,
	TEXT("When true FEditorBulkData will attempt to sync it's .upayload file via sourcecontrol if the first attempt to load from it fails"));

/** When enabled the bulkdata object will try pushing the payload when saved to disk as part of a package.
  * This is legacy behavior and likely to be removed

#Loc: <Workspace>/Engine/Source/Runtime/CoreUObject/Private/Serialization/EditorBulkData.cpp:1466

Scope (from outer to inner):

file
namespace    UE::Serialization
function     FCompressedBuffer FEditorBulkData::LoadFromSidecarFile

Source code excerpt:

		*PackagePath.GetLocalFullPath(EPackageSegment::PayloadSidecar));

	if (CVarShouldAllowSidecarSyncing.GetValueOnAnyThread())
	{
		FCompressedBuffer PayloadFromDisk = LoadFromSidecarFileInternal(ErrorVerbosity::None);
		if (PayloadFromDisk.IsNull())
		{
			UE_LOG(LogSerialization, Verbose, TEXT("Initial load from sidecar failed, attempting to sync the file: '%s'"),
				*PackagePath.GetLocalFullPath(EPackageSegment::PayloadSidecar));