2021-09-27 19:54:25 -04:00
|
|
|
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
|
|
|
|
|
|
#include "CookedEditorPackageManager.h"
|
2024-06-20 14:52:12 -04:00
|
|
|
#include "Algo/Sort.h"
|
|
|
|
|
#include "Algo/Unique.h"
|
2022-11-03 14:18:47 -04:00
|
|
|
#include "AssetRegistry/AssetData.h"
|
2021-09-27 19:54:25 -04:00
|
|
|
#include "CoreMinimal.h"
|
|
|
|
|
#include "Logging/LogMacros.h"
|
2022-05-02 18:06:48 -04:00
|
|
|
#include "AssetRegistry/AssetRegistryModule.h"
|
|
|
|
|
#include "AssetRegistry/IAssetRegistry.h"
|
|
|
|
|
#include "AssetRegistry/AssetRegistryModule.h"
|
2021-09-27 19:54:25 -04:00
|
|
|
#include "Engine/AssetManager.h"
|
|
|
|
|
#include "GameDelegates.h"
|
|
|
|
|
|
|
|
|
|
DEFINE_LOG_CATEGORY_STATIC(LogCookedEditorTargetPlatform, Log, All)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-02-15 11:46:19 -05:00
|
|
|
TUniquePtr<ICookedEditorPackageManager> ICookedEditorPackageManager::FactoryForTargetPlatform(bool bIsCookedCooker)
|
2021-09-27 19:54:25 -04:00
|
|
|
{
|
|
|
|
|
if (FGameDelegates::Get().GetCookedEditorPackageManagerFactoryDelegate().IsBound())
|
|
|
|
|
{
|
|
|
|
|
return FGameDelegates::Get().GetCookedEditorPackageManagerFactoryDelegate().Execute();
|
|
|
|
|
}
|
2021-11-07 23:43:01 -05:00
|
|
|
return TUniquePtr<ICookedEditorPackageManager>(new FIniCookedEditorPackageManager(bIsCookedCooker));
|
2021-09-27 19:54:25 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void ICookedEditorPackageManager::AddPackagesFromPath(TArray<FName>& Packages, const TCHAR* Path, EPackageSearchMode SearchMode) const
|
|
|
|
|
{
|
|
|
|
|
UAssetManager& AssetManager = UAssetManager::Get();
|
|
|
|
|
IAssetRegistry& AssetRegistry = AssetManager.GetAssetRegistry();
|
|
|
|
|
|
|
|
|
|
TArray<FAssetData> AssetDatas;
|
|
|
|
|
// look up the path in the asset registry, so we can use it to make sure the asset can be cooked
|
|
|
|
|
AssetRegistry.GetAssetsByPath(Path, AssetDatas, SearchMode == EPackageSearchMode::Recurse, true);
|
|
|
|
|
for (const FAssetData& AssetData : AssetDatas)
|
|
|
|
|
{
|
2021-11-07 23:43:01 -05:00
|
|
|
if (AssetData.IsUAsset() && AssetManager.VerifyCanCookPackage(nullptr, AssetData.PackageName, false))
|
2021-09-27 19:54:25 -04:00
|
|
|
{
|
|
|
|
|
if (AllowAssetToBeGathered(AssetData))
|
|
|
|
|
{
|
|
|
|
|
Packages.Add(AssetData.PackageName);
|
|
|
|
|
UE_LOG(LogCookedEditorTargetPlatform, Verbose, TEXT(" Adding asset %s to be cooked"), *AssetData.PackageName.ToString());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
UE_LOG(LogCookedEditorTargetPlatform, Verbose, TEXT(" skipping asset package %s"), *AssetData.PackageName.ToString());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2024-02-15 11:46:19 -05:00
|
|
|
void ICookedEditorPackageManager::GatherAllPackagesExceptDisabled(TArray<FName>& PackageNames, const TArray<FString>& DisabledPlugins) const
|
2021-09-27 19:54:25 -04:00
|
|
|
{
|
|
|
|
|
GetEnginePackagesToCook(PackageNames);
|
|
|
|
|
GetProjectPackagesToCook(PackageNames);
|
|
|
|
|
|
2021-11-07 23:43:01 -05:00
|
|
|
// copy array to set for faster contains calls
|
2021-09-27 19:54:25 -04:00
|
|
|
TSet<FString> CookedEditorDisabledPlugins;
|
2021-11-07 23:43:01 -05:00
|
|
|
CookedEditorDisabledPlugins.Append(DisabledPlugins);
|
2021-09-27 19:54:25 -04:00
|
|
|
|
|
|
|
|
// walk over plugins and cook their content
|
|
|
|
|
for (TSharedRef<IPlugin> Plugin : IPluginManager::Get().GetEnabledPluginsWithContent())
|
|
|
|
|
{
|
|
|
|
|
if (!CookedEditorDisabledPlugins.Contains(Plugin->GetName()))
|
|
|
|
|
{
|
|
|
|
|
// check if this engine or project plugin shuold be cooked
|
|
|
|
|
bool bShouldCook = (Plugin->GetLoadedFrom() == EPluginLoadedFrom::Engine) ? AllowEnginePluginContentToBeCooked(Plugin) :
|
|
|
|
|
AllowProjectPluginContentToBeCooked(Plugin);
|
|
|
|
|
|
|
|
|
|
if (bShouldCook)
|
|
|
|
|
{
|
|
|
|
|
UE_LOG(LogCookedEditorTargetPlatform, Display, TEXT("Adding enabled plugin with content: %s"), *Plugin->GetName());
|
|
|
|
|
AddPackagesFromPath(PackageNames, *Plugin->GetMountedAssetPath(), EPackageSearchMode::Recurse);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2021-10-12 21:21:22 -04:00
|
|
|
|
|
|
|
|
FilterGatheredPackages(PackageNames);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ICookedEditorPackageManager::FilterGatheredPackages(TArray<FName>& PackageNames) const
|
|
|
|
|
{
|
|
|
|
|
|
2021-09-27 19:54:25 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-11-07 23:43:01 -05:00
|
|
|
FIniCookedEditorPackageManager::FIniCookedEditorPackageManager(bool bInIsCookedCooker)
|
|
|
|
|
: bIsCookedCooker(bInIsCookedCooker)
|
2021-09-27 19:54:25 -04:00
|
|
|
{
|
2021-11-07 23:43:01 -05:00
|
|
|
EngineAssetPaths = GetConfigArray(TEXT("EngineAssetPaths"));
|
|
|
|
|
ProjectAssetPaths = GetConfigArray(TEXT("ProjectAssetPaths"));
|
|
|
|
|
DisallowedPathsToGather = GetConfigArray(TEXT("DisallowedPathsToGather"));
|
|
|
|
|
DisabledPlugins = GetConfigArray(TEXT("DisabledPlugins"));
|
2024-06-20 14:52:12 -04:00
|
|
|
}
|
2021-09-27 19:54:25 -04:00
|
|
|
|
2024-06-20 14:52:12 -04:00
|
|
|
void FIniCookedEditorPackageManager::InitializeClasses()
|
|
|
|
|
{
|
|
|
|
|
if (bClassesInitialized)
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
bClassesInitialized = true;
|
|
|
|
|
|
|
|
|
|
IAssetRegistry& AssetRegistry = IAssetRegistry::GetChecked();
|
|
|
|
|
// SearchAllAssets should be a noop because the cooker already did it, but run it just in case.
|
|
|
|
|
AssetRegistry.SearchAllAssets(true /* bSynchronousSearch */);
|
|
|
|
|
|
|
|
|
|
constexpr TCHAR WildcardCharacter = '*';
|
|
|
|
|
|
|
|
|
|
TArray<FString> DisallowedObjectClassWildcards;
|
2021-11-07 23:43:01 -05:00
|
|
|
TArray<FString> DisallowedObjectClassNamesToLoad = GetConfigArray(TEXT("DisallowedObjectClassesToLoad"));;
|
2024-06-20 14:52:12 -04:00
|
|
|
for (TArray<FString>::TIterator Iter(DisallowedObjectClassNamesToLoad); Iter; ++Iter)
|
|
|
|
|
{
|
|
|
|
|
FString& ClassName = *Iter;
|
|
|
|
|
int32 UnusedIndex;
|
|
|
|
|
if (ClassName.FindChar(WildcardCharacter, UnusedIndex))
|
|
|
|
|
{
|
|
|
|
|
DisallowedObjectClassWildcards.Add(MoveTemp(ClassName));
|
|
|
|
|
Iter.RemoveCurrentSwap();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (!DisallowedObjectClassWildcards.IsEmpty())
|
|
|
|
|
{
|
|
|
|
|
// Get the list of all blueprint and native classes from the AssetRegistry
|
|
|
|
|
TArray<FTopLevelAssetPath> ClassNamesUObject;
|
|
|
|
|
ClassNamesUObject.Add(FTopLevelAssetPath(UObject::StaticClass()));
|
|
|
|
|
TSet<FTopLevelAssetPath> AllClasses;
|
|
|
|
|
AssetRegistry.GetDerivedClassNames(ClassNamesUObject, TSet<FTopLevelAssetPath>(), AllClasses);
|
|
|
|
|
|
|
|
|
|
// Check the wildcards from config against each classpath
|
|
|
|
|
TSet<FString> MatchingClassPaths;
|
|
|
|
|
FString ClassPathStr;
|
|
|
|
|
for (FTopLevelAssetPath& ClassPath : AllClasses)
|
|
|
|
|
{
|
|
|
|
|
ClassPath.ToString(ClassPathStr);
|
|
|
|
|
bool bMatches = false;
|
|
|
|
|
for (const FString& Wildcard : DisallowedObjectClassWildcards)
|
|
|
|
|
{
|
|
|
|
|
if (ClassPathStr.MatchesWildcard(Wildcard, ESearchCase::IgnoreCase))
|
|
|
|
|
{
|
|
|
|
|
bMatches = true;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (bMatches)
|
|
|
|
|
{
|
|
|
|
|
DisallowedObjectClassNamesToLoad.Add(ClassPathStr);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Algo::Sort(DisallowedObjectClassNamesToLoad);
|
|
|
|
|
DisallowedObjectClassNamesToLoad.SetNum(Algo::Unique(DisallowedObjectClassNamesToLoad));
|
|
|
|
|
TArray<FTopLevelAssetPath> DisallowedObjectBaseClassPaths;
|
|
|
|
|
DisallowedObjectBaseClassPaths.Reserve(DisallowedObjectClassNamesToLoad.Num());
|
2021-09-27 19:54:25 -04:00
|
|
|
for (const FString& ClassName : DisallowedObjectClassNamesToLoad)
|
|
|
|
|
{
|
Deprecating ANY_PACKAGE.
This change consists of multiple changes:
Core:
- Deprecation of ANY_PACKAGE macro. Added ANY_PACKAGE_DEPRECATED macro which can still be used for backwards compatibility purposes (only used in CoreUObject)
- Deprecation of StaticFindObjectFast* functions that take bAnyPackage parameter
- Added UStruct::GetStructPathName function that returns FTopLevelAssetPath representing the path name (package + object FName, super quick compared to UObject::GetPathName) + wrapper UClass::GetClassPathName to make it look better when used with UClasses
- Added (Static)FindFirstObject* functions that find a first object given its Name (no Outer). These functions are used in places I consider valid to do global UObject (UClass) lookups like parsing command line parameters / checking for unique object names
- Added static UClass::TryFindType function which serves a similar purpose as FindFirstObject however it's going to throw a warning (with a callstack / maybe ensure in the future?) if short class name is provided. This function is used in places that used to use short class names but now should have been converted to use path names to catch any potential regressions and or edge cases I missed.
- Added static UClass::TryConvertShortNameToPathName utility function
- Added static UClass::TryFixShortClassNameExportPath utility function
- Object text export paths will now also include class path (Texture2D'/Game/Textures/Grass.Grass' -> /Script/Engine.Texture2D'/Game/Textures/Grass.Grass')
- All places that manually generated object export paths for objects will now use FObjectPropertyBase::GetExportPath
- Added a new startup test that checks for short type names in UClass/FProperty MetaData values
AssetRegistry:
- Deprecated any member variables (FAssetData / FARFilter) or functions that use FNames to represent class names and replaced them with FTopLevelAssetPath
- Added new member variables and new function overloads that use FTopLevelAssetPath to represent class names
- This also applies to a few other modules' APIs to match AssetRegistry changes
Everything else:
- Updated code that used ANY_PACKAGE (depending on the use case) to use FindObject(nullptr, PathToObject), UClass::TryFindType (used when path name is expected, warns if it's a short name) or FindFirstObject (usually for finding types based on user input but there's been a few legitimate use cases not related to user input)
- Updated code that used AssetRegistry API to use FTopLevelAssetPaths and USomeClass::StaticClass()->GetClassPathName() instead of GetFName()
- Updated meta data and hardcoded FindObject(ANY_PACKAGE, "EEnumNameOrClassName") calls to use path names
#jira UE-99463
#rb many.people
[FYI] Marcus.Wassmer
#preflight 629248ec2256738f75de9b32
#codereviewnumbers 20320742, 20320791, 20320799, 20320756, 20320809, 20320830, 20320840, 20320846, 20320851, 20320863, 20320780, 20320765, 20320876, 20320786
#ROBOMERGE-OWNER: robert.manuszewski
#ROBOMERGE-AUTHOR: robert.manuszewski
#ROBOMERGE-SOURCE: CL 20430220 via CL 20433854 via CL 20435474 via CL 20435484
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v949-20362246)
[CL 20448496 by robert manuszewski in ue5-main branch]
2022-06-01 03:46:59 -04:00
|
|
|
check(FPackageName::IsValidObjectPath(ClassName));
|
2024-06-20 14:52:12 -04:00
|
|
|
FTopLevelAssetPath ClassPath(ClassName);
|
|
|
|
|
check(ClassPath.IsValid());
|
|
|
|
|
DisallowedObjectBaseClassPaths.Add(ClassPath);
|
2021-09-27 19:54:25 -04:00
|
|
|
}
|
|
|
|
|
|
2024-06-20 14:52:12 -04:00
|
|
|
DisallowedObjectClassesToLoad.Reset();
|
|
|
|
|
AssetRegistry.GetDerivedClassNames(DisallowedObjectBaseClassPaths, TSet<FTopLevelAssetPath>(),
|
|
|
|
|
DisallowedObjectClassesToLoad);
|
|
|
|
|
|
2021-11-07 23:43:01 -05:00
|
|
|
TArray<FString> DisallowedAssetClassNamesToGather = GetConfigArray(TEXT("DisallowedAssetClassesToGather"));;
|
2021-09-27 19:54:25 -04:00
|
|
|
for (const FString& ClassName : DisallowedAssetClassNamesToGather)
|
|
|
|
|
{
|
Deprecating ANY_PACKAGE.
This change consists of multiple changes:
Core:
- Deprecation of ANY_PACKAGE macro. Added ANY_PACKAGE_DEPRECATED macro which can still be used for backwards compatibility purposes (only used in CoreUObject)
- Deprecation of StaticFindObjectFast* functions that take bAnyPackage parameter
- Added UStruct::GetStructPathName function that returns FTopLevelAssetPath representing the path name (package + object FName, super quick compared to UObject::GetPathName) + wrapper UClass::GetClassPathName to make it look better when used with UClasses
- Added (Static)FindFirstObject* functions that find a first object given its Name (no Outer). These functions are used in places I consider valid to do global UObject (UClass) lookups like parsing command line parameters / checking for unique object names
- Added static UClass::TryFindType function which serves a similar purpose as FindFirstObject however it's going to throw a warning (with a callstack / maybe ensure in the future?) if short class name is provided. This function is used in places that used to use short class names but now should have been converted to use path names to catch any potential regressions and or edge cases I missed.
- Added static UClass::TryConvertShortNameToPathName utility function
- Added static UClass::TryFixShortClassNameExportPath utility function
- Object text export paths will now also include class path (Texture2D'/Game/Textures/Grass.Grass' -> /Script/Engine.Texture2D'/Game/Textures/Grass.Grass')
- All places that manually generated object export paths for objects will now use FObjectPropertyBase::GetExportPath
- Added a new startup test that checks for short type names in UClass/FProperty MetaData values
AssetRegistry:
- Deprecated any member variables (FAssetData / FARFilter) or functions that use FNames to represent class names and replaced them with FTopLevelAssetPath
- Added new member variables and new function overloads that use FTopLevelAssetPath to represent class names
- This also applies to a few other modules' APIs to match AssetRegistry changes
Everything else:
- Updated code that used ANY_PACKAGE (depending on the use case) to use FindObject(nullptr, PathToObject), UClass::TryFindType (used when path name is expected, warns if it's a short name) or FindFirstObject (usually for finding types based on user input but there's been a few legitimate use cases not related to user input)
- Updated code that used AssetRegistry API to use FTopLevelAssetPaths and USomeClass::StaticClass()->GetClassPathName() instead of GetFName()
- Updated meta data and hardcoded FindObject(ANY_PACKAGE, "EEnumNameOrClassName") calls to use path names
#jira UE-99463
#rb many.people
[FYI] Marcus.Wassmer
#preflight 629248ec2256738f75de9b32
#codereviewnumbers 20320742, 20320791, 20320799, 20320756, 20320809, 20320830, 20320840, 20320846, 20320851, 20320863, 20320780, 20320765, 20320876, 20320786
#ROBOMERGE-OWNER: robert.manuszewski
#ROBOMERGE-AUTHOR: robert.manuszewski
#ROBOMERGE-SOURCE: CL 20430220 via CL 20433854 via CL 20435474 via CL 20435484
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v949-20362246)
[CL 20448496 by robert manuszewski in ue5-main branch]
2022-06-01 03:46:59 -04:00
|
|
|
check(FPackageName::IsValidObjectPath(ClassName));
|
|
|
|
|
UClass* Class = FindObject<UClass>(nullptr, *ClassName);
|
2021-09-27 19:54:25 -04:00
|
|
|
check(Class);
|
|
|
|
|
|
|
|
|
|
DisallowedAssetClassesToGather.Add(Class);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2021-11-07 23:43:01 -05:00
|
|
|
TArray<FString> FIniCookedEditorPackageManager::GetConfigArray(const TCHAR* Key) const
|
2024-05-31 17:08:31 -04:00
|
|
|
{
|
|
|
|
|
return GetConfigArray(Key, bIsCookedCooker);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TArray<FString> FIniCookedEditorPackageManager::GetConfigArray(const TCHAR* Key, bool bIsCookedCooker)
|
2021-11-07 23:43:01 -05:00
|
|
|
{
|
|
|
|
|
const TCHAR* SharedIniSection = TEXT("CookedEditorSettings");
|
|
|
|
|
const TCHAR* SpecificiIniSection = bIsCookedCooker ? TEXT("CookedEditorSettings_CookedCooker") : TEXT("CookedEditorSettings_CookedEditor");
|
|
|
|
|
|
|
|
|
|
TArray<FString> TempArray;
|
|
|
|
|
TArray<FString> ResultArray;
|
|
|
|
|
|
|
|
|
|
GConfig->GetArray(SpecificiIniSection, Key, ResultArray, GGameIni);
|
|
|
|
|
GConfig->GetArray(SharedIniSection, Key, TempArray, GGameIni);
|
|
|
|
|
ResultArray.Append(TempArray);
|
|
|
|
|
|
|
|
|
|
return ResultArray;
|
|
|
|
|
}
|
|
|
|
|
|
2024-02-15 11:46:19 -05:00
|
|
|
void FIniCookedEditorPackageManager::GatherAllPackages(TArray<FName>& PackageNames) const
|
2021-11-07 23:43:01 -05:00
|
|
|
{
|
2024-06-20 14:52:12 -04:00
|
|
|
check(bClassesInitialized); // Should be set by InitializeClasses from InitializeForCook
|
2024-02-15 11:46:19 -05:00
|
|
|
GatherAllPackagesExceptDisabled(PackageNames, DisabledPlugins);
|
2021-11-07 23:43:01 -05:00
|
|
|
}
|
|
|
|
|
|
2021-10-12 21:21:22 -04:00
|
|
|
void FIniCookedEditorPackageManager::FilterGatheredPackages(TArray<FName>& PackageNames) const
|
|
|
|
|
{
|
|
|
|
|
// now filter based on ini settings
|
|
|
|
|
PackageNames.RemoveAll([this](FName& AssetPath)
|
|
|
|
|
{
|
2022-10-14 17:52:09 -04:00
|
|
|
FNameBuilder AssetPathBuilder(AssetPath);
|
2022-10-14 17:50:06 -04:00
|
|
|
const FStringView AssetPathView(AssetPathBuilder);
|
2021-10-12 21:21:22 -04:00
|
|
|
for (const FString& Path : DisallowedPathsToGather)
|
|
|
|
|
{
|
2022-10-14 17:50:06 -04:00
|
|
|
if (AssetPathView.StartsWith(Path))
|
2021-10-12 21:21:22 -04:00
|
|
|
{
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
});
|
2022-01-20 22:15:10 -05:00
|
|
|
PackageNames.Remove(NAME_None);
|
2021-10-12 21:21:22 -04:00
|
|
|
}
|
2021-09-27 19:54:25 -04:00
|
|
|
|
2024-06-20 14:52:12 -04:00
|
|
|
void FIniCookedEditorPackageManager::InitializeForCook()
|
|
|
|
|
{
|
|
|
|
|
InitializeClasses();
|
|
|
|
|
}
|
|
|
|
|
|
2021-09-27 19:54:25 -04:00
|
|
|
void FIniCookedEditorPackageManager::GetEnginePackagesToCook(TArray<FName>& PackagesToCook) const
|
|
|
|
|
{
|
|
|
|
|
for (const FString& Path : EngineAssetPaths)
|
|
|
|
|
{
|
|
|
|
|
AddPackagesFromPath(PackagesToCook, *Path, EPackageSearchMode::Recurse);
|
|
|
|
|
}
|
|
|
|
|
|
2021-11-07 23:43:01 -05:00
|
|
|
// specific assets to cook
|
|
|
|
|
PackagesToCook.Append(GetConfigArray(TEXT("EngineSpecificAssetsToCook")));
|
2021-09-27 19:54:25 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
if (GConfig->GetString(TEXT("/Script/EngineSettings.GameMapsSettings"), TEXT("EditorStartupMap"), EditorStartupMap, GEngineIni))
|
|
|
|
|
{
|
|
|
|
|
PackagesToCook.Add(*EditorStartupMap);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// specific assets to cook
|
2021-11-07 23:43:01 -05:00
|
|
|
PackagesToCook.Append(GetConfigArray(TEXT("ProjectSpecificAssetsToCook")));
|
2021-09-27 19:54:25 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool FIniCookedEditorPackageManager::AllowObjectToBeCooked(const class UObject* Obj) const
|
|
|
|
|
{
|
2024-06-20 14:52:12 -04:00
|
|
|
check(bClassesInitialized); // Should be set by InitializeClasses from InitializeForCook
|
|
|
|
|
const UClass* ObjAsClass = Cast<UClass>(Obj);
|
|
|
|
|
|
|
|
|
|
// A pointer to a disallowed native class is not filtered out, only instances of the native class are
|
|
|
|
|
// filtered out. For non-native classes, both the pointer to the non-native class and instances of the class
|
|
|
|
|
// are filtered out.
|
|
|
|
|
if (!ObjAsClass || !ObjAsClass->IsNative())
|
2021-09-27 19:54:25 -04:00
|
|
|
{
|
2024-06-20 14:52:12 -04:00
|
|
|
const UClass* ClassToCheck = ObjAsClass ? ObjAsClass : Obj->GetClass();
|
|
|
|
|
if (DisallowedObjectClassesToLoad.Contains(ClassToCheck->GetClassPathName()))
|
2021-09-27 19:54:25 -04:00
|
|
|
{
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool FIniCookedEditorPackageManager::AllowAssetToBeGathered(const struct FAssetData& AssetData) const
|
|
|
|
|
{
|
2024-06-20 14:52:12 -04:00
|
|
|
check(bClassesInitialized); // Should be set by InitializeClasses from InitializeForCook
|
2021-09-27 19:54:25 -04:00
|
|
|
for (UClass* Class : DisallowedAssetClassesToGather)
|
|
|
|
|
{
|
2022-03-21 09:00:36 -04:00
|
|
|
if (AssetData.IsInstanceOf(Class))
|
2021-09-27 19:54:25 -04:00
|
|
|
{
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool FIniCookedEditorPackageManager::AllowEnginePluginContentToBeCooked(const TSharedRef<IPlugin>) const
|
|
|
|
|
{
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool FIniCookedEditorPackageManager::AllowProjectPluginContentToBeCooked(const TSharedRef<IPlugin>) const
|
|
|
|
|
{
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|