UAssetManager::GetPackageManagers
#include "Engine/AssetManager.h"
Access: public
Specifiers: virtualconst
Description
Returns every primary asset that manages a package in any way, whether through chunk assignment or cook inclusion. A simpler overload taking a TSet<FPrimaryAssetId>& (keys only) is also available when you don't need the dependency property.
Caveats & Gotchas
- • This is a superset of GetPackageCookRuleManagers, since chunk-assignment management doesn't necessarily imply cook inclusion — don't assume every manager returned here affects whether the package cooks.
- • This calls into a protected GetPackageManagersInternal helper; if you need to distinguish cook-rule references specifically, use GetPackageCookRuleManagers instead rather than trying to filter this result yourself.
Signature
virtual bool GetPackageManagers(FName PackageName, bool bRecurseToParents, TMap<FPrimaryAssetId, UE::AssetRegistry::EDependencyProperty>& Managers) const; Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| PackageName | FName | Package to find 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 every primary asset that manages a package C++
UAssetManager& Manager = UAssetManager::Get();
TMap<FPrimaryAssetId, UE::AssetRegistry::EDependencyProperty> Managers;
if (Manager.GetPackageManagers(TEXT("/Game/Items/Sword"), /*bRecurseToParents=*/false, Managers))
{
UE_LOG(LogTemp, Log, TEXT("%d primary assets manage this package"), Managers.Num());
} Tags
Version History
Introduced in: unknown
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?