bSerializeSearchableNameDependencies
bSerializeSearchableNameDependencies
#Overview
name: bSerializeSearchableNameDependencies
The value of this variable can be defined or overridden in .ini config files. 1
.ini config file referencing this setting variable.
It is referenced in 6
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of bSerializeSearchableNameDependencies is to control whether searchable name dependencies are serialized in the Asset Registry system of Unreal Engine 5. This variable is primarily used for managing asset dependencies and optimizing the serialization process.
The Unreal Engine subsystem that relies on this setting variable is the Asset Registry, which is part of the engine’s core asset management system. It’s used in the AssetRegistry module, specifically in the FAssetRegistryState and FDependsNode classes.
The value of this variable is typically set in the engine configuration files (INI files). It’s read from the “[AssetRegistry]” section of the engine INI file using the key “bSerializeNameDependencies”.
This variable interacts with other serialization-related variables in the FAssetRegistrySerializationOptions struct, such as bSerializeAssetRegistry, bSerializeDependencies, and bSerializeManageDependencies. Together, these variables control different aspects of asset registry serialization.
Developers must be aware that enabling this variable will increase the size of serialized data and potentially impact performance during loading and saving of the asset registry. It should be used judiciously, particularly in projects with a large number of assets.
Best practices when using this variable include:
- Only enable it when detailed name dependency information is necessary for your project’s asset management needs.
- Consider the performance implications, especially for large projects or when targeting platforms with limited resources.
- Use it in conjunction with other serialization options to fine-tune the asset registry’s behavior.
- Be consistent in its usage across different build configurations to avoid unexpected behavior.
- When modifying this setting, thoroughly test asset loading, cooking, and packaging processes to ensure compatibility with your project’s requirements.
#Setting Variables
#References In INI files
Location: <Workspace>/Engine/Config/BaseEngine.ini:2737, section: [AssetRegistry]
- INI Section:
AssetRegistry
- Raw value:
false
- Is Array:
False
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/AssetRegistry/Private/AssetRegistry.cpp:1310
Scope (from outer to inner):
file
namespace UE::AssetRegistry
namespace Utils
function void InitializeSerializationOptionsFromIni
Source code excerpt:
EngineIni->GetBool(TEXT("AssetRegistry"), TEXT("bSerializeAssetRegistry"), Options.bSerializeAssetRegistry);
EngineIni->GetBool(TEXT("AssetRegistry"), TEXT("bSerializeDependencies"), Options.bSerializeDependencies);
EngineIni->GetBool(TEXT("AssetRegistry"), TEXT("bSerializeNameDependencies"), Options.bSerializeSearchableNameDependencies);
EngineIni->GetBool(TEXT("AssetRegistry"), TEXT("bSerializeManageDependencies"), Options.bSerializeManageDependencies);
EngineIni->GetBool(TEXT("AssetRegistry"), TEXT("bSerializePackageData"), Options.bSerializePackageData);
EngineIni->GetBool(TEXT("AssetRegistry"), TEXT("bFilterAssetDataWithNoTags"), Options.bFilterAssetDataWithNoTags);
EngineIni->GetBool(TEXT("AssetRegistry"), TEXT("bFilterDependenciesWithNoTags"), Options.bFilterDependenciesWithNoTags);
EngineIni->GetBool(TEXT("AssetRegistry"), TEXT("bFilterSearchableNames"), Options.bFilterSearchableNames);
}
#Loc: <Workspace>/Engine/Source/Runtime/AssetRegistry/Private/AssetRegistryState.cpp:1405
Scope (from outer to inner):
file
function bool FAssetRegistryState::Save
Source code excerpt:
if (Node->GetIdentifier().IsPackage()
|| (Options.bSerializeSearchableNameDependencies && Node->GetIdentifier().IsValue())
|| (Options.bSerializeManageDependencies && Node->GetIdentifier().GetPrimaryAssetId().IsValid()))
{
Dependencies.Add(Node);
}
}
Algo::Sort(Dependencies, [](FDependsNode* A, FDependsNode* B) { return A->GetIdentifier().LexicalLess(B->GetIdentifier()); });
#Loc: <Workspace>/Engine/Source/Runtime/AssetRegistry/Private/DependsNode.cpp:642
Scope (from outer to inner):
file
function void FDependsNode::SerializeSave
Source code excerpt:
WriteDependencies(PackageDependencies, &PackageFlags, PackageFlagSetWidth, false);
WriteDependencies(Options.bSerializeSearchableNameDependencies ? NameDependencies : FDependsNodeList(), nullptr, 0, false);
WriteDependencies(Options.bSerializeManageDependencies ? ManageDependencies : FDependsNodeList(), Options.bSerializeManageDependencies ? &ManageFlags : nullptr, ManageFlagSetWidth, false);
WriteDependencies(Referencers, nullptr, 0, true);
}
void FDependsNode::SerializeLoad(FArchive& Ar, const TUniqueFunction<FDependsNode* (int32)>& GetNodeFromSerializeIndex, FLoadScratch& Scratch)
{
#Loc: <Workspace>/Engine/Source/Runtime/AssetRegistry/Private/DependsNodeTest.cpp:1115
Scope (from outer to inner):
file
function bool FDependsNodeTest::RunTest
Source code excerpt:
FAssetRegistrySerializationOptions Options(UE::AssetRegistry::ESerializationTarget::ForDevelopment);
Options.bSerializeSearchableNameDependencies = bKeepNameDependencies;
Options.bSerializeManageDependencies = bKeepManageDependencies;
TArray<uint8> Bytes;
{
FMemoryWriter Writer(Bytes);
A.SerializeSave(Writer, GetSerializeIndexFromNode, SaveScratch, Options);
#Loc: <Workspace>/Engine/Source/Runtime/AssetRegistry/Public/AssetRegistry/AssetRegistryState.h:56
Scope: file
Source code excerpt:
/** True rather to load/save dependency info for Name references, */
bool bSerializeSearchableNameDependencies = false;
/** True rather to load/save dependency info for Manage references, */
bool bSerializeManageDependencies = false;
/** If true will read/write FAssetPackageData */
bool bSerializePackageData = false;
#Loc: <Workspace>/Engine/Source/Runtime/AssetRegistry/Public/AssetRegistry/AssetRegistryState.h:102
Scope (from outer to inner):
file
function void InitForDevelopment
Source code excerpt:
void InitForDevelopment()
{
bSerializeAssetRegistry = bSerializeDependencies = bSerializeSearchableNameDependencies = bSerializeManageDependencies = bSerializePackageData = true;
DisableFilters();
}
};
struct FAssetRegistryLoadOptions
{