UAssetManager::GetPrimaryAssetTypeInfo
#include "Engine/AssetManager.h"
Access: public
Specifiers: virtualconst
Description
Gets metadata for a specific primary asset type, returning false if that type hasn't been registered.
Caveats & Gotchas
- • Types are normally registered from the Primary Asset Types Rules list in project settings or via calls to ScanPathsForPrimaryAssets — a typo in the type name is a common cause of this returning false.
- • AssetTypeInfo is left unmodified when the type isn't found, so don't assume it's zeroed out on failure.
Signature
virtual bool GetPrimaryAssetTypeInfo(FPrimaryAssetType PrimaryAssetType, FPrimaryAssetTypeInfo& AssetTypeInfo) const; Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| PrimaryAssetType | FPrimaryAssetType | Primary asset type to look up metadata for. | — |
| AssetTypeInfo | FPrimaryAssetTypeInfo& | Out parameter filled with the type's registered metadata (base class, scan paths, rules, etc.) if found. | — |
Return Type
bool Example
Check a type's base class C++
FPrimaryAssetTypeInfo TypeInfo;
if (UAssetManager::Get().GetPrimaryAssetTypeInfo(FPrimaryAssetType(TEXT("Item")), TypeInfo))
{
UE_LOG(LogTemp, Log, TEXT("Item base class: %s"), *TypeInfo.AssetBaseClassLoaded->GetName());
} Tags
Version History
Introduced in: unknown
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?