RealDocs

UAssetManager::GetPrimaryAssetIdForPackage

function Engine Since unknown
#include "Engine/AssetManager.h"
Access: public Specifiers: virtualconst

Description

Checks whether the given package has a registered primary asset id, useful when only the package name is available rather than a full object path.

Caveats & Gotchas

  • Package names lack the object subpath (the `.AssetName` suffix), so this only works when the primary asset id maps directly onto a package rather than a sub-object within it.
  • Returns an invalid FPrimaryAssetId if the package isn't registered — always check IsValid() before using the result.

Signature

virtual FPrimaryAssetId GetPrimaryAssetIdForPackage(FName PackagePath) const;

Parameters

Name Type Description Default
PackagePath FName Package path to test, e.g. from FAssetData::PackageName.

Return Type

FPrimaryAssetId

Example

Identify from a package name C++
FPrimaryAssetId Id = UAssetManager::Get().GetPrimaryAssetIdForPackage(FName(TEXT("/Game/Items/Sword")));

Version History

Introduced in: unknown

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.