UAssetManager::GetPackageCookRuleManagers
#include "Engine/AssetManager.h"
Access: public
Specifiers: virtualconst
Description
Returns the primary assets that determine whether a package is included in the cook, along with whether each reference is direct or indirect.
Caveats & Gotchas
- • This only reports cook-inclusion managers; chunk-assignment managers that don't affect whether the package cooks at all are excluded — use GetPackageManagers if you need the superset.
- • bRecurseToParents can return a much larger manager set for deeply-nested asset references, since it follows the dependency chain upward rather than stopping at the first direct manager.
Signature
virtual bool GetPackageCookRuleManagers(FName PackageName, bool bRecurseToParents, TMap<FPrimaryAssetId, UE::AssetRegistry::EDependencyProperty>& Managers) const; Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| PackageName | FName | Package to find cook-rule managers for. | — |
| bRecurseToParents | bool | If true, also walks up to managers of parent packages that reference this one indirectly. | — |
| Managers | TMap<FPrimaryAssetId, UE::AssetRegistry::EDependencyProperty>& | Out map of managing primary assets to the dependency property describing the reference. | — |
Return Type
bool Example
Find why a package is being cooked C++
UAssetManager& Manager = UAssetManager::Get();
TMap<FPrimaryAssetId, UE::AssetRegistry::EDependencyProperty> Managers;
if (Manager.GetPackageCookRuleManagers(TEXT("/Game/Items/Sword"), /*bRecurseToParents=*/true, Managers))
{
for (const auto& Pair : Managers)
{
UE_LOG(LogTemp, Log, TEXT("Cooked because of %s"), *Pair.Key.ToString());
}
} Tags
Version History
Introduced in: unknown
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?