DisallowedAssetClassesToGather

DisallowedAssetClassesToGather

#Overview

name: DisallowedAssetClassesToGather

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

#Summary

#Usage in the C++ source code

The purpose of DisallowedAssetClassesToGather is to maintain a list of asset classes that should not be gathered during the cooking process in Unreal Engine 5. This variable is part of the asset management and cooking system, specifically used in the CookedEditor module.

The CookedEditor module, which is part of the Unreal Engine’s development tools, relies on this setting variable. It’s used within the FIniCookedEditorPackageManager class, which implements the ICookedEditorPackageManager interface.

The value of this variable is set in the constructor of FIniCookedEditorPackageManager. It’s populated based on configuration settings read from an INI file, specifically from the “CookedEditorSettings” section.

DisallowedAssetClassesToGather interacts with other variables in the FIniCookedEditorPackageManager class, such as DisallowedObjectClassesToLoad and DisallowedPathsToGather. These variables work together to control what assets are included or excluded during the cooking process.

Developers must be aware that this variable directly impacts which assets are gathered during cooking. If an asset’s class is in this list, it will be excluded from the cooking process, which could lead to missing content in the final build if not managed correctly.

Best practices when using this variable include:

  1. Carefully consider which asset classes should be excluded to avoid unintended consequences.
  2. Regularly review and update the list as project requirements change.
  3. Ensure that excluded asset classes are not critical for the game’s functionality.
  4. Document any changes to this list to maintain clarity across the development team.
  5. Test thoroughly after making changes to ensure no essential assets are accidentally excluded.

By properly managing DisallowedAssetClassesToGather, developers can optimize the cooking process and control the content included in their game builds.

#Setting Variables

#References In INI files

Location: <Workspace>/Engine/Config/BaseGame.ini:251, section: [CookedEditorSettings]

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Developer/CookedEditor/Private/CookedEditorPackageManager.cpp:113

Scope (from outer to inner):

file
function     FIniCookedEditorPackageManager::FIniCookedEditorPackageManager

Source code excerpt:

		check(Class);

		DisallowedAssetClassesToGather.Add(Class);
	}
}

TArray<FString> FIniCookedEditorPackageManager::GetConfigArray(const TCHAR* Key) const
{
	const TCHAR* SharedIniSection = TEXT("CookedEditorSettings");

#Loc: <Workspace>/Engine/Source/Developer/CookedEditor/Private/CookedEditorPackageManager.cpp:199

Scope (from outer to inner):

file
function     bool FIniCookedEditorPackageManager::AllowAssetToBeGathered

Source code excerpt:

bool FIniCookedEditorPackageManager::AllowAssetToBeGathered(const struct FAssetData& AssetData) const
{
	for (UClass* Class : DisallowedAssetClassesToGather)
	{
		if (AssetData.IsInstanceOf(Class))
		{
			return false;
		}
	}

#Loc: <Workspace>/Engine/Source/Developer/CookedEditor/Public/CookedEditorPackageManager.h:149

Scope (from outer to inner):

file
class        class FIniCookedEditorPackageManager : public ICookedEditorPackageManager

Source code excerpt:

	TArray<FString> DisabledPlugins;
	TArray<UClass*> DisallowedObjectClassesToLoad;
	TArray<UClass*> DisallowedAssetClassesToGather;
	TArray<FString> DisallowedPathsToGather;

	// true if this is a cooked cooker (false for cooker editor)
	bool bIsCookedCooker;

	// gets an array from two sections, depending on bIsCookedCooker setting