RealDocs

UAssetManager::GetPrimaryAssetRules

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

Description

Returns the effective management rules for a primary asset, merging any per-asset override on top of its type's default rules.

Caveats & Gotchas

  • The returned struct is always the merged result — there's no way to see the type-level and per-asset override values separately from this call alone.
  • Reflects rules as of the current scan; changes made via SetPrimaryAssetRules or SetPrimaryAssetTypeRules after the fact are picked up immediately since this recomputes on every call.

Signature

virtual FPrimaryAssetRules GetPrimaryAssetRules(FPrimaryAssetId PrimaryAssetId) const;

Parameters

Name Type Description Default
PrimaryAssetId FPrimaryAssetId Primary asset to look up the effective management rules for.

Return Type

FPrimaryAssetRules

Example

Check an asset's effective cook rule C++
UAssetManager& Manager = UAssetManager::Get();
FPrimaryAssetRules Rules = Manager.GetPrimaryAssetRules(FPrimaryAssetId(TEXT("Item"), TEXT("Sword")));
if (Rules.CookRule == EPrimaryAssetCookRule::NeverCook)
{
	// This asset is intentionally excluded from cooked builds
}

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.