bDisableImmediateAssetDiscovery

bDisableImmediateAssetDiscovery

#Overview

name: bDisableImmediateAssetDiscovery

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 7 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of bDisableImmediateAssetDiscovery is to control the timing of asset discovery and metadata extraction in Unreal Engine’s Blueprint search system. Specifically, it allows for deferring the cost of extracting metadata for each discovered asset during the initial asset registry scan.

This setting variable is primarily used in the Blueprint search system, which is part of the Kismet module in Unreal Engine. It’s particularly relevant to the FFindInBlueprintSearchManager class, which manages the search functionality for Blueprints.

The value of this variable is set from the GEditorIni configuration file, under the “BlueprintSearchSettings” section. It’s initialized in the FFindInBlueprintSearchManager constructor and then loaded from the config file in the Initialize function.

bDisableImmediateAssetDiscovery interacts with other parts of the asset discovery and caching system. When it’s set to true, it affects how the BuildCache() function is called and how unloaded Blueprint search metadata is handled.

Developers should be aware that enabling this option (setting it to true) can significantly change the behavior of asset discovery:

  1. It delays the extraction of search metadata until after the initial asset registry scan is complete.
  2. It can potentially improve initial load times by deferring the metadata extraction process.
  3. However, it may result in a longer delay when first performing a Blueprint search, as the metadata will need to be extracted at that point.

Best practices when using this variable include:

  1. Consider enabling it (setting to true) in projects with a large number of assets to improve initial load times.
  2. Be prepared for potentially longer delays when first performing a Blueprint search after startup if this option is enabled.
  3. Monitor performance in both scenarios (enabled and disabled) to determine which setting works best for your specific project.
  4. Remember that changing this setting may require adjustments to other parts of your workflow that depend on immediate asset discovery.

#Setting Variables

#References In INI files

Location: <Workspace>/Engine/Config/BaseEditor.ini:543, section: [BlueprintSearchSettings]

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Editor/Kismet/Private/FindInBlueprintManager.cpp:2044

Scope (from outer to inner):

file
function     FFindInBlueprintSearchManager::FFindInBlueprintSearchManager

Source code excerpt:

	, bEnableDeveloperMenuTools(false)
	, bDisableSearchResultTemplates(false)
	, bDisableImmediateAssetDiscovery(false)
{
	for (int32 TabIdx = 0; TabIdx < UE_ARRAY_COUNT(GlobalFindResultsTabIDs); TabIdx++)
	{
		const FName TabID = FName(*FString::Printf(TEXT("GlobalFindResults_%02d"), TabIdx + 1));
		GlobalFindResultsTabIDs[TabIdx] = TabID;
	}

#Loc: <Workspace>/Engine/Source/Editor/Kismet/Private/FindInBlueprintManager.cpp:2085

Scope (from outer to inner):

file
function     void FFindInBlueprintSearchManager::Initialize

Source code excerpt:

	GConfig->GetBool(TEXT("BlueprintSearchSettings"), TEXT("bEnableDeveloperMenuTools"), bEnableDeveloperMenuTools, GEditorIni);
	GConfig->GetBool(TEXT("BlueprintSearchSettings"), TEXT("bDisableSearchResultTemplates"), bDisableSearchResultTemplates, GEditorIni);
	GConfig->GetBool(TEXT("BlueprintSearchSettings"), TEXT("bDisableImmediateAssetDiscovery"), bDisableImmediateAssetDiscovery, GEditorIni);

#if CSV_PROFILER
	// If profiling has been enabled, turn on the stat category and begin a capture.
	if (bEnableCSVStatsProfiling)
	{
		FCsvProfiler::Get()->EnableCategoryByString(TEXT("FindInBlueprint"));

#Loc: <Workspace>/Engine/Source/Editor/Kismet/Private/FindInBlueprintManager.cpp:2130

Scope (from outer to inner):

file
function     void FFindInBlueprintSearchManager::Initialize

Source code excerpt:

	FCoreUObjectDelegates::ReloadCompleteDelegate.AddRaw(this, &FFindInBlueprintSearchManager::OnReloadComplete);

	if(!GIsSavingPackage && AssetRegistryModule && (!bDisableImmediateAssetDiscovery || !AssetRegistryModule->GetRegistry().IsLoadingAssets()))
	{
		// Do an immediate load of the cache to catch any Blueprints that were discovered by the asset registry before we initialized.
		BuildCache();
	}

	// Register global find results tabs.

#Loc: <Workspace>/Engine/Source/Editor/Kismet/Private/FindInBlueprintManager.cpp:2190

Scope (from outer to inner):

file
function     void FFindInBlueprintSearchManager::AddUnloadedBlueprintSearchMetadata

Source code excerpt:

	if (Result.IsSet())
	{
		if (bDisableImmediateAssetDiscovery)
		{
			// If the versioned key is set at all, we assume it is valid and will parse it later
			ExtractUnloadedFiBData(InAssetData, nullptr, FBlueprintTags::FindInBlueprintsData, EFiBVersion::FIB_VER_NONE);
		}
		else
		{

#Loc: <Workspace>/Engine/Source/Editor/Kismet/Private/FindInBlueprintManager.cpp:2215

Scope (from outer to inner):

file
function     void FFindInBlueprintSearchManager::AddUnloadedBlueprintSearchMetadata

Source code excerpt:

		if (ResultLegacy.IsSet())
		{
			if (bDisableImmediateAssetDiscovery)
			{
				ExtractUnloadedFiBData(InAssetData, nullptr, FBlueprintTags::UnversionedFindInBlueprintsData, EFiBVersion::FIB_VER_BASE);
			}
			else
			{
				FString FiBUnversionedSearchData = ResultLegacy.GetValue();

#Loc: <Workspace>/Engine/Source/Editor/Kismet/Private/FindInBlueprintManager.cpp:2457

Scope (from outer to inner):

file
function     void FFindInBlueprintSearchManager::OnAssetRegistryFilesLoaded

Source code excerpt:

	// If we've deferred asset discovery, scan all registered assets now to extract search metadata from the asset tags.
	// Note: Depending on how many assets there are (loaded/unloaded), this may block the UI frame for an extended period.
	if (bDisableImmediateAssetDiscovery)
	{
		BuildCache();
	}

	if (!IsCacheInProgress() && PendingAssets.Num() == 0)
	{

#Loc: <Workspace>/Engine/Source/Editor/Kismet/Public/FindInBlueprintManager.h:899

Scope (from outer to inner):

file
class        class FFindInBlueprintSearchManager : public FTickableEditorObject

Source code excerpt:


	/** Defers the cost to extract metadata for each discovered asset during the initial asset registry scan into a single pass over the full asset registry once the scan is complete. */
	bool bDisableImmediateAssetDiscovery;
};

struct KISMET_API FDisableGatheringDataOnScope
{
	bool bOriginallyEnabled;
	FDisableGatheringDataOnScope() : bOriginallyEnabled(FFindInBlueprintSearchManager::Get().IsGatheringDataEnabled())