class

FPrimaryAssetManager

The Asset Manager (UE's UAssetManager, ROADMAP §23.3): which assets are primary — the roots a game loads by id and a cook starts from — and the rules that hang off them, chunk and cook rule. Configured the UE way, in DefaultGame.ini:

Module
AssetSystem
Header
#include "AssetSystem/PrimaryAssetManager.h"
Namespace
Mowo

[/Script/Mowo.AssetManagerSettings] +PrimaryAssetTypesToScan=(PrimaryAssetType="Map",AssetClass="World",Directories=("Content/Maps"),Rules=(ChunkId=1,CookRule=AlwaysCook))

A primary asset's chunk spreads over its hard dependencies (soft ones load on demand and may live anywhere); an asset two chunks reach goes to the lower one, the rule the cook's chunk split already applies.

Properties

TypeNameDescription
static constexpr const char*SettingsSectionDefault "/Script/Mowo.AssetManagerSettings".
static constexpr const char*ChunkManifestFileDefault "Chunks.ini".
static constexpr const char*LegacyChunkManifestFileDefault "Chunks.mdf".
static constexpr const char*ChunkManifestHeaderDefault "; Generated from DefaultGame.ini".
static constexpr const char*BundleTagPrefixBundles come from two places: a package's registry tags bundle.<Name> (';'-separated paths, written with the asset) and +PrimaryAssetBundles=(PrimaryAssetId="Map:Rooftop",BundleName="UI",Assets=("Content/UI/HUD.ui")) rows in the settings section, for assets that are not packages yet. Default "bundle.".

Public functions

ReturnsNameDescription
boolParseStructUE's struct spelling, "(Key=Value,Key=(Nested),Key="Text")", into its top-level fields; nested parentheses and quotes are kept whole.
std::vector<std::string>ParseListA parenthesised list, "(a,"b",(c))", into its elements, unquoted.
const char*CookRuleName
EPrimaryAssetCookRuleCookRuleFromString
uint32_tLoadSettingsReads every PrimaryAssetTypesToScan row of the settings section.
voidAddType
const std::vector<FPrimaryAssetTypeInfo>&GetTypes
uint32_tScanFinds every registry entry a type claims.
std::vector<FPrimaryAssetId>GetPrimaryAssetIdList
const FPrimaryAssetData*Find
std::map<uint64_t, int32_t>ComputeChunkAssignmentUUID value -> chunk, for every primary asset with a chunk and everything it hard-references.
std::stringBuildChunkManifestConfig/Chunks.ini text the cook reads: World primaries as +Scenes=, the directories of every other chunked type as +Dirs=, under the generator's header line: ; Generated from DefaultGame.ini [...] — edit the primary asset rules, not this file.
boolIsGeneratedChunkManifestWhether the generator may replace a manifest whose first line is this: its own header, in the INI or the legacy MDF spelling.
boolConvertLegacyChunkManifestThe legacy Chunks.mdf (Chunk "N" { scene: dir: plugin: budget_mb: }) as Chunks.ini text.
std::filesystem::pathResolveChunkManifest<configDir>/Chunks.ini, after converting a legacy Chunks.mdf beside it (the original moves to Saved/MigratedSources/Config).
std::vector<std::string>GetCookPathsThe paths of the primary assets with exactly this cook rule — what a cook must include (AlwaysCook) or leave out (NeverCook).
std::stringBuildCookRulesThe rules as the cook reads them (mbt cook / mbt package shell MowoGame --primary-assets= --cook-rules-out=), one per line: never <path> leave the asset out even though Content/ holds it always <path> ship it even though no cooked level references it AlwaysCook and DevelopmentAlwaysCook primaries are always with every bundle asset; a NeverCook primary is never, its bundles untouched (a bundle may be shared with a primary that does ship).
std::vector<std::string>GetBundlePaths
std::vector<UUID>CollectLoadSetWhat LoadPrimaryAsset loads: the primary asset and every asset of the named bundles, as registry ids.
voidLoadPrimaryAssetUE's LoadPrimaryAsset: every id of CollectLoadSet through the runtime asset manager's async path; onDone runs on the main thread once each has called back, true when all of them loaded.

Function details

ParseStruct

C++
static bool ParseStruct(const std::string& text, std::vector<std::pair<std::string, std::string>>& out)

UE's struct spelling, "(Key=Value,Key=(Nested),Key="Text")", into its top-level fields; nested parentheses and quotes are kept whole.

ParseList

C++
static std::vector<std::string> ParseList(const std::string& text)

A parenthesised list, "(a,"b",(c))", into its elements, unquoted.

CookRuleName

C++
static const char* CookRuleName(EPrimaryAssetCookRule rule)

CookRuleFromString

C++
static EPrimaryAssetCookRule CookRuleFromString(const std::string& text)

LoadSettings

C++
uint32_t LoadSettings(const FConfigIniFile& gameIni, std::vector<std::string>* errors = nullptr)

Reads every PrimaryAssetTypesToScan row of the settings section. Returns how many types were added; a malformed row is skipped and named in errors.

AddType

C++
void AddType(const FPrimaryAssetTypeInfo& type)

GetTypes

C++
const std::vector<FPrimaryAssetTypeInfo>& GetTypes() const

Scan

C++
uint32_t Scan(const AssetRegistry& registry, std::vector<std::string>* errors = nullptr)

Finds every registry entry a type claims. A name two assets of one type would share keeps the first by path and reports the second.

GetPrimaryAssetIdList

C++
std::vector<FPrimaryAssetId> GetPrimaryAssetIdList(const std::string& type) const

Find

C++
const FPrimaryAssetData* Find(const FPrimaryAssetId& id) const

ComputeChunkAssignment

C++
std::map<uint64_t, int32_t> ComputeChunkAssignment(const AssetRegistry& registry) const

UUID value -> chunk, for every primary asset with a chunk and everything it hard-references.

BuildChunkManifest

C++
std::string BuildChunkManifest() const

Config/Chunks.ini text the cook reads: World primaries as +Scenes=, the directories of every other chunked type as +Dirs=, under the generator's header line: ; Generated from DefaultGame.ini [...] — edit the primary asset rules, not this file. [Chunk 1] +Scenes=Content/Maps/Expansion.mmap +Dirs=Content/Weapons A hand-written manifest adds +Plugins= and BudgetMB=.

IsGeneratedChunkManifest

C++
static bool IsGeneratedChunkManifest(const std::string& firstLine)

Whether the generator may replace a manifest whose first line is this: its own header, in the INI or the legacy MDF spelling. Anything else was written by a person.

ConvertLegacyChunkManifest

C++
static bool ConvertLegacyChunkManifest(const std::string& legacyText, std::string& outIni, std::string* error = nullptr)

The legacy Chunks.mdf (Chunk "N" { scene: dir: plugin: budget_mb: }) as Chunks.ini text. Read line by line, not through MdfDocument: one chunk repeats a key, and a document node holds a key once.

ResolveChunkManifest

C++
static std::filesystem::path ResolveChunkManifest(const std::filesystem::path& projectConfigDir)

<configDir>/Chunks.ini, after converting a legacy Chunks.mdf beside it (the original moves to Saved/MigratedSources/Config). The cook reads either; the editor and --write-chunks convert before they write.

GetCookPaths

C++
std::vector<std::string> GetCookPaths(EPrimaryAssetCookRule rule) const

The paths of the primary assets with exactly this cook rule — what a cook must include (AlwaysCook) or leave out (NeverCook).

BuildCookRules

C++
std::string BuildCookRules() const

The rules as the cook reads them (mbt cook / mbt package shell MowoGame --primary-assets= --cook-rules-out=), one per line: never <path> leave the asset out even though Content/ holds it always <path> ship it even though no cooked level references it AlwaysCook and DevelopmentAlwaysCook primaries are always with every bundle asset; a NeverCook primary is never, its bundles untouched (a bundle may be shared with a primary that does ship).

GetBundlePaths

C++
std::vector<std::string> GetBundlePaths(const FPrimaryAssetId& id, const std::string& bundle) const

CollectLoadSet

C++
std::vector<UUID> CollectLoadSet(const FPrimaryAssetId& id, const std::vector<std::string>& bundles, const AssetRegistry& registry, std::vector<std::string>* missing = nullptr) const

What LoadPrimaryAsset loads: the primary asset and every asset of the named bundles, as registry ids. A bundle path the registry does not know is reported in missing rather than skipped silently.

LoadPrimaryAsset

C++
void LoadPrimaryAsset(const FPrimaryAssetId& id, const std::vector<std::string>& bundles, RuntimeAssetManager& assets, std::function<void(bool)> onDone) const

UE's LoadPrimaryAsset: every id of CollectLoadSet through the runtime asset manager's async path; onDone runs on the main thread once each has called back, true when all of them loaded.

Generated from AssetSystem/PrimaryAssetManager.h via assetsystem.json · Nov 4, 2026Version 1.0.0