RealDocs

UKismetSystemLibrary::GetPrimaryAssetIdFromObject

function Engine Blueprint Since unknown
#include "Kismet/KismetSystemLibrary.h"
Access: public Specifiers: staticUFUNCTIONBlueprintPure

Description

Returns the Primary Asset Id registered for an object. Returns an invalid Primary Asset Id if the object is not registered with the Asset Manager.

Caveats & Gotchas

  • Returns an invalid (default-constructed) FPrimaryAssetId, not null, when unregistered — check with IsValidPrimaryAssetId rather than relying on truthiness.
  • Requires the object's class or the object itself to have been scanned via a Primary Asset rule in the Asset Manager settings; arbitrary UObjects are not automatically registered.

Signature

static FPrimaryAssetId GetPrimaryAssetIdFromObject(UObject* Object)

Parameters

Name Type Description Default
Object UObject* The loaded object instance to look up.

Return Type

FPrimaryAssetId

Example

Look up an asset's registered Id C++
FPrimaryAssetId AssetId = UKismetSystemLibrary::GetPrimaryAssetIdFromObject(MyLoadedAsset);
if (UKismetSystemLibrary::IsValidPrimaryAssetId(AssetId))
{
	UE_LOG(LogTemp, Log, TEXT("Id: %s"), *AssetId.ToString());
}

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.