RealDocs

UKismetSystemLibrary::GetPrimaryAssetIdFromClass

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

Description

Returns the Primary Asset Id registered for a class, such as a Blueprint class marked as a Primary Asset. Returns an invalid Id if the class is not registered.

Caveats & Gotchas

  • Check the result with IsValidPrimaryAssetId — an unregistered class does not return null, it returns a default-constructed invalid Id.
  • Only classes covered by a Primary Asset Type rule in the Asset Manager settings (Project Settings > Asset Manager) will resolve.

Signature

static FPrimaryAssetId GetPrimaryAssetIdFromClass(TSubclassOf<UObject> Class)

Parameters

Name Type Description Default
Class TSubclassOf<UObject> The class to look up.

Return Type

FPrimaryAssetId

Example

Get the Id for a Blueprint class C++
TSubclassOf<AActor> ItemClass = LoadClass<AActor>(nullptr, TEXT("/Game/Items/BP_Sword.BP_Sword_C"));
FPrimaryAssetId AssetId = UKismetSystemLibrary::GetPrimaryAssetIdFromClass(ItemClass);

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.