DisabledPlugins

DisabledPlugins

#Overview

name: DisabledPlugins

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

It is referenced in 6 C++ source files. Also referenced in 2 C# build files meaning it may affect the build system logic.

#Summary

#Usage in the C++ source code

The purpose of DisabledPlugins is to maintain a list of plugins that are forcibly disabled in the Unreal Engine 5 game features system. This setting variable is primarily used for managing plugin activation and deactivation, particularly in scenarios where certain plugins need to be disabled, such as during hotfixes or for specific build configurations.

DisabledPlugins is mainly utilized by the Game Features subsystem and the Cooked Editor package management system. These systems rely on this variable to determine which plugins should be excluded from loading or processing.

The value of this variable is typically set in configuration files, such as BaseGame.ini or DefaultGame.ini. It can be modified through the Unreal Engine editor interface or programmatically.

DisabledPlugins interacts with other variables and systems, including:

  1. AdditionalPluginMetadataKeys in the GameFeaturesSubsystemSettings
  2. The plugin management system (IPluginManager)
  3. Package gathering and filtering mechanisms in the Cooked Editor system

Developers should be aware of the following when using this variable:

  1. Disabling plugins can affect game functionality, so it should be used carefully.
  2. Changes to this variable may require rebuilding or re-cooking of the project.
  3. It impacts both runtime behavior and editor/development processes.

Best practices for using DisabledPlugins include:

  1. Maintain a clear record of why specific plugins are disabled.
  2. Regularly review the list to ensure it’s up-to-date and necessary.
  3. Test thoroughly after modifying the list to ensure no critical functionality is broken.
  4. Use it in conjunction with other plugin management tools and practices for a comprehensive approach to plugin control.
  5. Consider using it as part of a larger strategy for managing game features and optimizing performance.

#Setting Variables

#References In INI files

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

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

Location: <Workspace>/Engine/Config/BaseGame.ini:294, section: [CookedEditorSettings_CookedEditor]

Location: <Workspace>/Engine/Config/BaseGame.ini:295, section: [CookedEditorSettings_CookedEditor]

Location: <Workspace>/Engine/Config/BaseGame.ini:296, section: [CookedEditorSettings_CookedEditor]

Location: <Workspace>/Engine/Config/BaseGame.ini:298, section: [CookedEditorSettings_CookedEditor]

Location: <Workspace>/Engine/Config/BaseGame.ini:299, section: [CookedEditorSettings_CookedEditor]

Location: <Workspace>/Engine/Config/BaseGame.ini:301, section: [CookedEditorSettings_CookedEditor]

Location: <Workspace>/Engine/Config/BaseGame.ini:302, section: [CookedEditorSettings_CookedEditor]

Location: <Workspace>/Engine/Config/BaseGame.ini:303, section: [CookedEditorSettings_CookedEditor]

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Plugins/Runtime/GameFeatures/Source/GameFeatures/Public/GameFeaturesSubsystemSettings.h:30

Scope (from outer to inner):

file
class        class UGameFeaturesSubsystemSettings : public UDeveloperSettings

Source code excerpt:

	/** List of plugins that are forcibly disabled (e.g., via a hotfix) */
	UPROPERTY(config, EditAnywhere, Category=GameFeatures)
	TArray<FString> DisabledPlugins;

	/** List of metadata (additional keys) to try parsing from the .uplugin to provide to FGameFeaturePluginDetails */
	UPROPERTY(config, EditAnywhere, Category=GameFeatures)
	TArray<FString> AdditionalPluginMetadataKeys;

	UE_DEPRECATED(5.0, "Use IsValidGameFeaturePlugin() instead")

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

Scope (from outer to inner):

file
function     void ICookedEditorPackageManager::GatherAllPackagesExceptDisabled

Source code excerpt:

}

void ICookedEditorPackageManager::GatherAllPackagesExceptDisabled(TArray<FName>& PackageNames, const ITargetPlatform* TargetPlatform, const TArray<FString>& DisabledPlugins) const
{
	GetEnginePackagesToCook(PackageNames);
	GetProjectPackagesToCook(PackageNames);

	// copy array to set for faster contains calls
	TSet<FString> CookedEditorDisabledPlugins;
	CookedEditorDisabledPlugins.Append(DisabledPlugins);

	// walk over plugins and cook their content
	for (TSharedRef<IPlugin> Plugin : IPluginManager::Get().GetEnabledPluginsWithContent())
	{
		if (!CookedEditorDisabledPlugins.Contains(Plugin->GetName()))
		{

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

Scope (from outer to inner):

file
function     FIniCookedEditorPackageManager::FIniCookedEditorPackageManager

Source code excerpt:

	ProjectAssetPaths = GetConfigArray(TEXT("ProjectAssetPaths"));
	DisallowedPathsToGather = GetConfigArray(TEXT("DisallowedPathsToGather"));
	DisabledPlugins = GetConfigArray(TEXT("DisabledPlugins"));

	TArray<FString> DisallowedObjectClassNamesToLoad = GetConfigArray(TEXT("DisallowedObjectClassesToLoad"));;
	for (const FString& ClassName : DisallowedObjectClassNamesToLoad)
	{
		check(FPackageName::IsValidObjectPath(ClassName));
		UClass* Class = FindObject<UClass>(nullptr, *ClassName);

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

Scope (from outer to inner):

file
function     void FIniCookedEditorPackageManager::GatherAllPackages

Source code excerpt:

void FIniCookedEditorPackageManager::GatherAllPackages(TArray<FName>& PackageNames, const ITargetPlatform* TargetPlatform) const
{
	GatherAllPackagesExceptDisabled(PackageNames, TargetPlatform, DisabledPlugins);
}

void FIniCookedEditorPackageManager::FilterGatheredPackages(TArray<FName>& PackageNames) const
{
	// now filter based on ini settings
	PackageNames.RemoveAll([this](FName& AssetPath)

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

Scope (from outer to inner):

file
class        class ICookedEditorPackageManager

Source code excerpt:

	 * Meat of this class, this calls other functions that generally will be overridden - subclass needs to pass in disabled plugins
	 */
	void GatherAllPackagesExceptDisabled(TArray<FName>& PackageNames, const ITargetPlatform* TargetPlatform, const TArray<FString>& DisabledPlugins) const;
};



/**
 * An implentation of ICookedEditorPackageManager that uses BaseGame.ini / DefaultGame.ini to control cooked editor packaging setup

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

Scope (from outer to inner):

file
class        class FIniCookedEditorPackageManager : public ICookedEditorPackageManager

Source code excerpt:

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

#References in C# build files

This variable is referenced in the following C# build files:

Location: <Workspace>/Engine/Source/Programs/UnrealBuildTool/Configuration/TargetRules.cs:3020

				allDisabledPlugins.AddRange(disabledPlugins);
			}
			if (projectGameIni.GetArray("CookedEditorSettings" + (bIsCookedCooker ? "_CookedCooker" : "_CookedEditor"), "DisabledPlugins", out disabledPlugins))
			{
				allDisabledPlugins.AddRange(disabledPlugins);
			}
			if (Configuration == UnrealTargetConfiguration.Shipping)
			{
				if (projectGameIni.GetArray("CookedEditorSettings", "DisabledPluginsInShipping", out disabledPlugins))

Location: <Workspace>/Engine/Source/Programs/UnrealBuildTool/Configuration/TargetRules.cs:3016

			List<string> allDisabledPlugins = new List<string>();

			if (projectGameIni.GetArray("CookedEditorSettings", "DisabledPlugins", out disabledPlugins))
			{
				allDisabledPlugins.AddRange(disabledPlugins);
			}
			if (projectGameIni.GetArray("CookedEditorSettings" + (bIsCookedCooker ? "_CookedCooker" : "_CookedEditor"), "DisabledPlugins", out disabledPlugins))
			{
				allDisabledPlugins.AddRange(disabledPlugins);