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
| Type | Name | Description |
|---|---|---|
static constexpr uint32_t | kSchemaVersion | Current .mdfprefab container schema. Stamped on the Prefab root when written; an absent marker on load is treated as v1 (pre-versioning). Default 1. |
Constructors
| Signature | Name | Description |
|---|---|---|
PrefabAsset() | PrefabAsset | |
~PrefabAsset() override | ~PrefabAsset |
Public functions
| Returns | Name | Description |
|---|---|---|
bool | Load | Asset interface |
void | Unload | |
bool | CreateGPU | |
bool | LoadFromString | Parse a prefab straight from an MDF string — no VFS round-trip. |
const std::string& | GetPrefabName | |
const std::vector<PrefabEntityData>& | GetEntities | |
uint32_t | GetLoadedSchemaVersion | The schema_version the file on disk carried when it was read (0 = never loaded). |
bool | CanSaveOver | 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. |
const std::string& | GetNewerContentReason | Why CanSaveOver refuses (empty when it does not). |
bool | CarriesUnknownKeys | Whether an instance keeps the component keys this build does not know for the next write (FContentVersionStamp::CarriesUnknownKeys). |
void | CollectDependencyIDs | |
void | CollectDependencyPaths |
Function details
PrefabAsset
PrefabAsset()~PrefabAsset
~PrefabAsset() overrideLoad
bool Load(const std::string& path) overrideAsset interface
Unload
void Unload() overrideCreateGPU
bool CreateGPU(const GPUContext& ctx) overrideLoadFromString
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
const std::string& GetPrefabName() constGetEntities
const std::vector<PrefabEntityData>& GetEntities() constGetLoadedSchemaVersion
uint32_t GetLoadedSchemaVersion() constThe 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
bool CanSaveOver() constFalse, 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
const std::string& GetNewerContentReason() constWhy CanSaveOver refuses (empty when it does not).
CarriesUnknownKeys
bool CarriesUnknownKeys() constWhether an instance keeps the component keys this build does not know for the next write (FContentVersionStamp::CarriesUnknownKeys).
CollectDependencyIDs
void CollectDependencyIDs(std::vector<UUID>& out) const overrideCollectDependencyPaths
void CollectDependencyPaths(std::vector<std::string>& out) const override