ProjectAssetPaths

ProjectAssetPaths

#Overview

name: ProjectAssetPaths

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 ProjectAssetPaths is to store a list of paths to project-specific assets that need to be processed or cooked in Unreal Engine 5. This variable is primarily used in the context of the Cooked Editor system, which is responsible for managing and preparing assets for cooked builds of the game or project.

ProjectAssetPaths is utilized by the CookedEditor module, specifically within the FIniCookedEditorPackageManager class. This class is part of the asset management and cooking process in Unreal Engine 5.

The value of this variable is set through a configuration file, likely an INI file. It is populated using the GetConfigArray function with the key “ProjectAssetPaths”.

ProjectAssetPaths interacts with other variables in the FIniCookedEditorPackageManager class, such as EngineAssetPaths, DisallowedPathsToGather, and DisabledPlugins. These variables work together to define the scope of assets to be processed during the cooking process.

Developers must be aware that:

  1. The paths stored in ProjectAssetPaths are used to determine which project-specific assets should be included in the cooked build.
  2. Changes to this variable will directly affect which assets are processed and included in the final build.
  3. The paths should be relative to the project’s root directory to ensure portability across different development environments.

Best practices when using this variable include:

  1. Regularly review and update the paths to ensure all necessary project assets are included.
  2. Use relative paths rather than absolute paths to maintain project portability.
  3. Coordinate with the team to ensure that any changes to the project structure are reflected in these paths.
  4. Consider using version control for the configuration files that set these paths to track changes over time.
  5. Be mindful of performance implications when adding large numbers of paths, as it may increase cooking time.

#Setting Variables

#References In INI files

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

Scope (from outer to inner):

file
function     FIniCookedEditorPackageManager::FIniCookedEditorPackageManager

Source code excerpt:

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

	TArray<FString> DisallowedObjectClassNamesToLoad = GetConfigArray(TEXT("DisallowedObjectClassesToLoad"));;
	for (const FString& ClassName : DisallowedObjectClassNamesToLoad)
	{

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

Scope (from outer to inner):

file
function     void FIniCookedEditorPackageManager::GetProjectPackagesToCook

Source code excerpt:

void FIniCookedEditorPackageManager::GetProjectPackagesToCook(TArray<FName>& PackagesToCook) const
{
	for (const FString& Path : ProjectAssetPaths)
	{
		AddPackagesFromPath(PackagesToCook, *Path, EPackageSearchMode::Recurse);
	}

	// make sure editor startup map is cooked
	FString EditorStartupMap;

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

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)