UAssetManager::SetPrimaryAssetTypeRules
#include "Engine/AssetManager.h"
Access: public
Specifiers: virtual
Description
Changes the default cook/chunk/priority management rules applied to every primary asset of a given type, unless overridden individually via SetPrimaryAssetRules.
Caveats & Gotchas
- • These are normally set once from data (e.g. Primary Data Asset Rules in project settings or PrimaryAssetTypesToScan) — calling this at runtime after the initial scan can change chunk assignment for a whole type on the fly, which most projects don't expect.
- • Per-asset overrides set via SetPrimaryAssetRules always take precedence over the type-level rules set here.
Signature
virtual void SetPrimaryAssetTypeRules(FPrimaryAssetType PrimaryAssetType, const FPrimaryAssetRules& Rules); Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| PrimaryAssetType | FPrimaryAssetType | Primary asset type to change the default management rules for. | — |
| Rules | const FPrimaryAssetRules& | New default rules (chunk id, cook rule, priority) applied to every asset of this type. | — |
Return Type
void Example
Force a type to always cook C++
UAssetManager& Manager = UAssetManager::Get();
FPrimaryAssetRules Rules;
Rules.CookRule = EPrimaryAssetCookRule::AlwaysCook;
Manager.SetPrimaryAssetTypeRules(FPrimaryAssetType(TEXT("Item")), Rules); Version History
Introduced in: unknown
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?