DisallowedObjectClassesToLoad

DisallowedObjectClassesToLoad

#Overview

name: DisallowedObjectClassesToLoad

The value of this variable can be defined or overridden in .ini config files. 2 .ini config files referencing this setting variable.

It is referenced in 3 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of DisallowedObjectClassesToLoad is to maintain a list of object classes that should not be loaded or cooked in the Unreal Engine’s cooking process.

This setting variable is primarily used in the Cooked Editor subsystem of Unreal Engine 5. It is part of the CookedEditor module, which is responsible for managing packages in a cooked (pre-processed) environment.

The value of this variable is set in the FIniCookedEditorPackageManager constructor. It is populated by reading class names from a configuration file and converting them to UClass pointers.

DisallowedObjectClassesToLoad interacts with other variables in the FIniCookedEditorPackageManager class, such as DisallowedAssetClassesToGather and DisallowedPathsToGather. These variables work together to control what content is allowed to be processed during the cooking phase.

Developers must be aware that this variable directly impacts which objects can be cooked and loaded in the editor. Objects of classes listed in DisallowedObjectClassesToLoad will be excluded from the cooking process, which can affect the final packaged content of the game or application.

Best practices when using this variable include:

  1. Carefully consider which classes should be added to this list to avoid unintentionally excluding necessary content.
  2. Keep the list up-to-date as the project evolves to ensure it accurately reflects the current needs of the project.
  3. Use this in conjunction with other filtering mechanisms (like DisallowedAssetClassesToGather and DisallowedPathsToGather) for comprehensive control over the cooking process.
  4. Document any changes to this list to maintain clear communication within the development team about what content is being excluded from the build.

#Setting Variables

#References In INI files

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

Location: <Workspace>/Engine/Config/BaseGame.ini:250, 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:103

Scope (from outer to inner):

file
function     FIniCookedEditorPackageManager::FIniCookedEditorPackageManager

Source code excerpt:

		check(Class);

		DisallowedObjectClassesToLoad.Add(Class);
	}

	TArray<FString> DisallowedAssetClassNamesToGather = GetConfigArray(TEXT("DisallowedAssetClassesToGather"));;
	for (const FString& ClassName : DisallowedAssetClassNamesToGather)
	{
		check(FPackageName::IsValidObjectPath(ClassName));

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

Scope (from outer to inner):

file
function     bool FIniCookedEditorPackageManager::AllowObjectToBeCooked

Source code excerpt:

bool FIniCookedEditorPackageManager::AllowObjectToBeCooked(const class UObject* Obj) const
{
	for (UClass* Class : DisallowedObjectClassesToLoad)
	{
		if (Obj->IsA(Class))
		{
			return false;
		}
	}

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

Scope (from outer to inner):

file
class        class FIniCookedEditorPackageManager : public ICookedEditorPackageManager

Source code excerpt:

	TArray<FString> ProjectAssetPaths;
	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;