class

PrefabAsset

Prefab asset (.mdfprefab) - stores entity hierarchy data for instantiation Component data stored as MdfNode; actual instantiation done by editor utilities

Module
AssetSystem
Header
#include "AssetSystem/Assets/PrefabAsset.h"
Namespace
Mowo

Properties

TypeNameDescription
static constexpr uint32_tkSchemaVersionCurrent .mdfprefab container schema. Stamped on the Prefab root when written; an absent marker on load is treated as v1 (pre-versioning). Default 1.

Constructors

SignatureNameDescription
PrefabAsset()PrefabAsset
~PrefabAsset() override~PrefabAsset

Public functions

ReturnsNameDescription
boolLoadAsset interface
voidUnload
boolCreateGPU
boolLoadFromStringParse a prefab straight from an MDF string — no VFS round-trip.
const std::string&GetPrefabName
const std::vector<PrefabEntityData>&GetEntities
uint32_tGetLoadedSchemaVersionThe schema_version the file on disk carried when it was read (0 = never loaded).
boolCanSaveOverFalse, with an error logged, when the file was written by a newer build: every writer of this prefab's path must ask before it overwrites, or the fields this build could not read are gone.
const std::string&GetNewerContentReasonWhy CanSaveOver refuses (empty when it does not).
boolCarriesUnknownKeysWhether an instance keeps the component keys this build does not know for the next write (FContentVersionStamp::CarriesUnknownKeys).
voidCollectDependencyIDs
voidCollectDependencyPaths

Function details

PrefabAsset

C++
PrefabAsset()

~PrefabAsset

C++
~PrefabAsset() override

Load

C++
bool Load(const std::string& path) override

Asset interface

Unload

C++
void Unload() override

CreateGPU

C++
bool CreateGPU(const GPUContext& ctx) override

LoadFromString

C++
bool LoadFromString(const std::string& mdf)

Parse a prefab straight from an MDF string — no VFS round-trip. Same schema/migration path as Load; used by tooling and tests that build prefab MDF in memory.

GetPrefabName

C++
const std::string& GetPrefabName() const

GetEntities

C++
const std::vector<PrefabEntityData>& GetEntities() const

GetLoadedSchemaVersion

C++
uint32_t GetLoadedSchemaVersion() const

The schema_version the file on disk carried when it was read (0 = never loaded). A prefab from a newer build loads best-effort, and this is how the writer knows the in-memory copy is missing fields.

CanSaveOver

C++
bool CanSaveOver() const

False, with an error logged, when the file was written by a newer build: every writer of this prefab's path must ask before it overwrites, or the fields this build could not read are gone. Newer means a newer schema, engine or plugin stamp, or a component stored above the version this build's descriptor knows.

GetNewerContentReason

C++
const std::string& GetNewerContentReason() const

Why CanSaveOver refuses (empty when it does not).

CarriesUnknownKeys

C++
bool CarriesUnknownKeys() const

Whether an instance keeps the component keys this build does not know for the next write (FContentVersionStamp::CarriesUnknownKeys).

CollectDependencyIDs

C++
void CollectDependencyIDs(std::vector<UUID>& out) const override

CollectDependencyPaths

C++
void CollectDependencyPaths(std::vector<std::string>& out) const override
Generated from AssetSystem/Assets/PrefabAsset.h via assetsystem.json · Nov 4, 2026Version 1.0.0