RealDocs

UAssetManager::ExtractChunkIdFromPrimaryAssetId

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

Description

Extracts the chunk index back out of a PrimaryAssetId created by CreatePrimaryAssetIdFromChunkId. Returns INDEX_NONE if the id isn't of PackageChunkType.

Caveats & Gotchas

  • Returns INDEX_NONE for any PrimaryAssetId that isn't PackageChunkType — check the return value before using it as an array index.
  • Only meaningful for ids produced by CreatePrimaryAssetIdFromChunkId; passing an arbitrary primary asset id is a valid no-op, not an error.

Signature

static int32 ExtractChunkIdFromPrimaryAssetId(const FPrimaryAssetId& PrimaryAssetId);

Parameters

Name Type Description Default
PrimaryAssetId const FPrimaryAssetId& Asset id to inspect; must be of PackageChunkType.

Return Type

int32

Example

Reading back a chunk id C++
int32 ChunkId = UAssetManager::ExtractChunkIdFromPrimaryAssetId(ChunkAssetId);
if (ChunkId != INDEX_NONE)
{
	UE_LOG(LogTemp, Log, TEXT("Chunk %d"), ChunkId);
}

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.