class

Scene

Scene class - contains entities and manages their lifecycle

Module
Game
Header
#include "Scene/Scene.h"
Namespace
Mowo

Type aliases

AliasDescription
using FRenderHook = void (*)(Scene& scene, SceneRenderer* renderer, uint32_t cullingMask)

Constructors

SignatureNameDescription
Scene()Scene
explicit Scene(const std::string& name)Scene
~Scene()~Scene

Public functions

ReturnsNameDescription
voidInitializeLifecycle
voidShutdown
voidOnUpdateEditorNew lifecycle API
voidOnUpdateRuntimeTicks all systems (= current Update)
voidOnUpdateSimulationTicks Transform + Physics + Animation + RectTransform
voidOnRenderDraws through the hook the renderer library installs when it loads; a host that never loads it (the dedicated server) has none, and the call does nothing.
voidSetRenderHook
FRenderHookGetRenderHook
voidOnRuntimeStartEnsures runtime systems present, calls init
voidOnRuntimeStopShuts down runtime-only systems
voidOnSimulationStartAdds Physics + Animation only
voidOnSimulationStopRemoves Physics + Animation
Scope<Scene>DeepCopyDocument round-trip (no text) → new Scene; name, path and env carried over
const std::string&GetNameScene metadata
voidSetName
const std::string&GetPath
voidSetPath
boolIsPlayWorldA play-in-editor world: a disposable copy of an edited document (or a level travelled to from one).
voidSetPlayWorld
voidSetWorldTypeWhat this scene's actor world is for (Editor, PIE, Game).
EWorldTypeGetWorldType
voidSetDefaultWorldType
GameObject*CreateGameObjectGameObject management (preferred API)
GameObject*GetGameObject
GameObject*FindGameObject
std::vector<GameObject*>FindGameObjectsWithTag
GameObject*FindGameObjectWithTag
EntityCreateEntityEntity management
EntityIDDuplicateEntity
voidDestroyEntity
std::stringResolveGameModeClassWorld Settings at play: the level's game-mode override wins over the project's; KillZ destroys every simulated body or character below the level's kill height and returns how many went.
size_tApplyKillZ
EntityFindEntity
std::vector<Entity>FindEntitiesWithTag
std::stringGetEntityNameEntity name access
const std::string&GetEntityNameRef
voidSetEntityName
std::stringGetEntityTagEntity tag access
const std::string&GetEntityTagRef
voidSetEntityTag
const std::string&GetEntityFolderOutliner organizational folder — pure editor metadata: it never affects the transform hierarchy or any runtime system, it only groups rows.
voidSetEntityFolder
uint32_tGetEntityLayerEntity layer access (0-31)
voidSetEntityLayer
EntityFindEntityWithTagFind first entity with tag (returns invalid entity if not found)
boolIsEntityActiveActive state (serialized — inactive entities skipped by systems)
voidSetEntityActive
boolIsEntityEditorHiddenEditor visibility — UE's bHiddenEd, serialized with the scene as the optional editor_hidden entity property (absent = visible, so every scene authored before this stays readable).
voidSetEntityEditorHidden
boolIsEntityEditorLockedEditor selection lock — the Outliner's padlock, kept with the level as the optional editor_locked property the way UE keeps bLockLocation, so a lock an author set survives closing the level.
voidSetEntityEditorLocked
boolShouldGatherEntityWhether a per-entity gather may submit this entity.
ESceneGatherContextGetGatherContext
voidSetGatherContext
std::stringGetEntityPrefabSourcePrefab instance tracking (editor-only)
voidSetEntityPrefabSource
int32_tGetEntityPrefabSourceIndexWhich entry (PrefabEntityData::index) of the source prefab this instance entity was spawned from.
voidSetEntityPrefabSourceIndex
voidCapturePrefabOverrideCapture the current value of a whole reflected component on a prefab instance as an override — a CDO-delta MDF blob (only properties that differ from the class default) keyed by the component display name.
voidCapturePrefabOverrideTest/tooling seam: capture against an explicit prefab asset instead of resolving the entity's source path through the AssetManager.
boolPropagatePrefabInstanceRe-instantiate a placed prefab instance from its source, then replay its stored overrides — the "propagate a prefab edit to instances" path.
voidSetParentEntity hierarchy
voidRemoveParent
EntityGetParent
std::vector<Entity>GetChildren
voidMoveEntityBeforeReorder entity in the list (for drag&drop reorder in hierarchy) Moves 'toMove' so it appears before 'before' in iteration order.
World*GetWorld
const World*GetWorld
boolIsLoadedScene state
boolIsDirty
voidMarkDirty
voidClearDirty
SceneEnvironment&GetEnvironmentEnvironment settings
const SceneEnvironment&GetEnvironment
voidEvaluateVolumesVolume framework EvaluateVolumes is the per-frame hook that walks the scene's VolumeComponents, blends their profiles using cameraPos, and writes the result back into m_environment.postProcess so the existing SceneRenderer read path picks it up unchanged.
voidResolveEnvironmentComponents
voidInvalidateVolumeBaselineForces re-capture of m_environment.postProcess as the baseline on the next EvaluateVolumes call.
voidRebaseWorldOriginOrigin rebasing.
const Vec3&GetWorldOriginOffset
Ref<RefCounted>GetNavDataNavigation mesh (baked per scene).
voidSetNavData
voidSetFocusHighlightProviderFocus-highlight provider (plugin seam): the interaction system used to be named here directly; now whoever owns "what entity should the renderer highlight" registers a captureless provider.
EntityID
EntityIDFindUnboundPlacedNetworkEntityReplication seam: the scene-placed entity a client-side Spawn packet should ADOPT instead of materializing a fresh ghost.
uint32_tAssignPlacedNetworkGuidsStamp a stable identity on every scene-placed NetworkObject that lacks one, and break any collision an old copy-paste left behind.
uint32_tReleaseAdoptedPlacedNetworkEntitiesHand every scene-placed NetworkObject back to the scene when a session ends.
FPointCloudAccumulator*GetOrCreatePointCloudAccumulatorScanned point clouds.
FPointCloudAccumulator*GetPointCloudAccumulator
boolAdoptPointCloudBlobReplace one entity's cloud from a .mpcl blob the caller already holds.
boolSaveToFileSerialization
boolLoadFromFile
boolIsExternalActorMapTrue when a save to path splits the level: a .mmap that already is a World package (world settings in the map, one .actor per actor under __ExternalActors__/, FExternalActorFiles), or a new one in a project on the package asset format.
boolLoadFromDocumentThe second half of LoadFromFile for a document the caller already read and parsed — on a worker, say, since the read and the parse are the part of an open that needs no world.
const std::string&GetNewerContentReasonWhy SaveToFile will refuse this scene (empty = it will not): the load read content a newer build wrote, and saving would drop what it added.
voidReloadBakedGiLoads <scene>.mgi, the baked GI fallback, into the environment (or clears it).
std::stringSerializeToMDF
boolDeserializeFromMDF
voidSerializeToDocumentDocument-level (de)serialization — no text round-trip.
boolDeserializeFromDocument
voidCapturePlayState
boolRestorePlayState
boolAddComponentByDisplayNameType-erased component add/remove by reflection display name ("Light", "Terrain", ...).
boolRemoveComponentByDisplayName
intMergeEntitiesFromMdfAdditive load: parses a serialized scene and appends its entities to this scene with *fresh* UUIDs (so two additive loads of the same MDF don't collide).
std::stringSerializeEntityTreeToMdfSerialize a single entity and all its descendants as a stand-alone MDF fragment.
EntityIDRestoreEntityTreeFromMdfInverse of SerializeEntityTreeToMdf.
std::stringSerializeEntityStateToMdf
boolApplyEntityStateFromMdf
boolSerializeEntityTreeToNodeThe node forms the world-state journal keeps, so a record stays a node from capture to save to overlay and is never text reparsed per entity.
EntityIDRestoreEntityTreeFromNode
boolSerializeEntityStateToNode
boolApplyEntityStateFromNode
std::unordered_map<std::string, std::string>RemapCopiedTreesCopy/paste and duplicate of a SET of trees (each an EntityTree node from SerializeEntityTreeToNode): one remap across the whole set, so every entity gets a fresh uuid and every parent link and actor or component reference naming another member of the set follows it to the copy.
voidResolveActorReferencesInTreesAfter every tree of a set is restored: re-resolves the actor references of each restored actor, so an edge to an actor from a later tree of the set lands (a single restore resolves only within its own tree).
boolIsEntityRuntimeSpawned
boolIsEntityTransientGenerated content: an entity an editor-time actor made for preview.
voidSetEntityTransient
FWorldStateJournal*GetWorldStateJournal
std::stringSerializePrefabFromEntitiesAuthor a .mdfprefab document from a live actor selection: every given root plus its descendants is written as index/parent_index Entity nodes carrying their reflected components, in the container shape PrefabAsset loads and PrefabInstantiator instantiates.
voidSetPrefabOverridePrefab override metadata (editor-only; serialized into the scene file so they survive save/reopen and source-prefab reimport).
std::stringGetPrefabOverride
boolHasPrefabOverride
const std::unordered_map<std::string, std::string>*GetPrefabOverrides
voidClearPrefabOverrides
voidForEachEntityIteration
voidForEachRootEntityIterate only root entities (no parent)
voidForEachGameObject
size_tGetEntityCountEntity count
voidPreserveUnknownComponentPassthrough for content this build cannot represent.
voidPreserveUnknownActor
voidCarryUnknownKeysKeeps the keys of node that desc does not know for the next save, replacing what was kept for that component before.
const std::vector<MDF::MdfNode>*GetPreservedComponents
voidUpdateHairStrandsSteps (or, with simulate false, rest-poses) every Hair Strands component's guides and rebuilds its render strands.
uint32_tGetHairInstanceCount
const FMeshRenderProxyCache&GetMeshRenderProxies

Function details

Scene

C++
Scene()

Scene

C++
explicit Scene(const std::string& name)

~Scene

C++
~Scene()

Initialize

C++
void Initialize()

Lifecycle

Shutdown

C++
void Shutdown()

OnUpdateEditor

C++
void OnUpdateEditor(float dt)

New lifecycle API

OnUpdateRuntime

C++
void OnUpdateRuntime(float dt)

Ticks all systems (= current Update)

OnUpdateSimulation

C++
void OnUpdateSimulation(float dt)

Ticks Transform + Physics + Animation + RectTransform

OnRender

C++
void OnRender(SceneRenderer* renderer, uint32_t cullingMask = 0xFFFFFFFF)

Draws through the hook the renderer library installs when it loads; a host that never loads it (the dedicated server) has none, and the call does nothing.

SetRenderHook

C++
static void SetRenderHook(FRenderHook hook)

GetRenderHook

C++
static FRenderHook GetRenderHook()

OnRuntimeStart

C++
void OnRuntimeStart()

Ensures runtime systems present, calls init

OnRuntimeStop

C++
void OnRuntimeStop()

Shuts down runtime-only systems

OnSimulationStart

C++
void OnSimulationStart()

Adds Physics + Animation only

OnSimulationStop

C++
void OnSimulationStop()

Removes Physics + Animation

DeepCopy

C++
Scope<Scene> DeepCopy() const

Document round-trip (no text) → new Scene; name, path and env carried over

GetName

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

Scene metadata

SetName

C++
void SetName(const std::string& name)

GetPath

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

SetPath

C++
void SetPath(const std::string& path)

IsPlayWorld

C++
bool IsPlayWorld() const

A play-in-editor world: a disposable copy of an edited document (or a level travelled to from one). Travel out of it loads a fresh copy rather than handing the game a scene the editor has open.

SetPlayWorld

C++
void SetPlayWorld(bool playWorld)

SetWorldType

C++
void SetWorldType(EWorldType type)

What this scene's actor world is for (Editor, PIE, Game). A new scene takes the process default, which the editor sets to Editor at startup, so actors constructed while the level loads already see the right answer; SetPlayWorld makes it PIE, and OnUpdateEditor keeps a non-play scene Editor.

GetWorldType

C++
EWorldType GetWorldType() const

SetDefaultWorldType

C++
static void SetDefaultWorldType(EWorldType type)

CreateGameObject

C++
GameObject* CreateGameObject(const std::string& name = "")

GameObject management (preferred API)

GetGameObject

C++
GameObject* GetGameObject(EntityID id)

FindGameObject

C++
GameObject* FindGameObject(const std::string& name) const

FindGameObjectsWithTag

C++
std::vector<GameObject*> FindGameObjectsWithTag(const std::string& tag) const

FindGameObjectWithTag

C++
GameObject* FindGameObjectWithTag(const std::string& tag) const

CreateEntity

C++
Entity CreateEntity(const std::string& name = "")

Entity management

DuplicateEntity

C++
EntityID DuplicateEntity(EntityID sourceId)

DestroyEntity

C++
void DestroyEntity(Entity entity)

ResolveGameModeClass

C++
static std::string ResolveGameModeClass(const Scene* scene, const std::string& projectGameMode)

World Settings at play: the level's game-mode override wins over the project's; KillZ destroys every simulated body or character below the level's kill height and returns how many went.

ApplyKillZ

C++
size_t ApplyKillZ()

FindEntity

C++
Entity FindEntity(const std::string& name) const

FindEntitiesWithTag

C++
std::vector<Entity> FindEntitiesWithTag(const std::string& tag) const

GetEntityName

C++
std::string GetEntityName(EntityID id) const

Entity name access

GetEntityNameRef

C++
const std::string& GetEntityNameRef(EntityID id) const

SetEntityName

C++
void SetEntityName(EntityID id, const std::string& name)

GetEntityTag

C++
std::string GetEntityTag(EntityID id) const

Entity tag access

GetEntityTagRef

C++
const std::string& GetEntityTagRef(EntityID id) const

SetEntityTag

C++
void SetEntityTag(EntityID id, const std::string& tag)

GetEntityFolder

C++
const std::string& GetEntityFolder(EntityID id) const

Outliner organizational folder — pure editor metadata: it never affects the transform hierarchy or any runtime system, it only groups rows. Serialized with the scene so the layout survives.

SetEntityFolder

C++
void SetEntityFolder(EntityID id, const std::string& folder)

GetEntityLayer

C++
uint32_t GetEntityLayer(EntityID id) const

Entity layer access (0-31)

SetEntityLayer

C++
void SetEntityLayer(EntityID id, uint32_t layer)

FindEntityWithTag

C++
Entity FindEntityWithTag(const std::string& tag) const

Find first entity with tag (returns invalid entity if not found)

IsEntityActive

C++
bool IsEntityActive(EntityID id) const

Active state (serialized — inactive entities skipped by systems)

SetEntityActive

C++
void SetEntityActive(EntityID id, bool active)

IsEntityEditorHidden

C++
bool IsEntityEditorHidden(EntityID id) const

Editor visibility — UE's bHiddenEd, serialized with the scene as the optional editor_hidden entity property (absent = visible, so every scene authored before this stays readable). Distinct from bHidden: this is an authoring aid, and Play must never inherit it.

SetEntityEditorHidden

C++
void SetEntityEditorHidden(EntityID id, bool hidden)

IsEntityEditorLocked

C++
bool IsEntityEditorLocked(EntityID id) const

Editor selection lock — the Outliner's padlock, kept with the level as the optional editor_locked property the way UE keeps bLockLocation, so a lock an author set survives closing the level.

SetEntityEditorLocked

C++
void SetEntityEditorLocked(EntityID id, bool locked)

ShouldGatherEntity

C++
static bool ShouldGatherEntity(ESceneGatherContext context, bool editorHidden)

Whether a per-entity gather may submit this entity. A designer who hid a wall to reach behind it must not ship a level with a hole, so the flag stops at the editor boundary rather than travelling into PIE, Simulate or the standalone runtime.

GetGatherContext

C++
ESceneGatherContext GetGatherContext() const

SetGatherContext

C++
void SetGatherContext(ESceneGatherContext context)

GetEntityPrefabSource

C++
std::string GetEntityPrefabSource(EntityID id) const

Prefab instance tracking (editor-only)

SetEntityPrefabSource

C++
void SetEntityPrefabSource(EntityID id, const std::string& path)

GetEntityPrefabSourceIndex

C++
int32_t GetEntityPrefabSourceIndex(EntityID id) const

Which entry (PrefabEntityData::index) of the source prefab this instance entity was spawned from. -1 = not a prefab instance. PrefabInstantiator stamps it on spawn; the live-link reapply path uses it to line each instance entity back up with its source entry.

SetEntityPrefabSourceIndex

C++
void SetEntityPrefabSourceIndex(EntityID id, int32_t index)

CapturePrefabOverride

C++
void CapturePrefabOverride(EntityID id, const std::string& componentDisplayName)

Capture the current value of a whole reflected component on a prefab instance as an override — a CDO-delta MDF blob (only properties that differ from the class default) keyed by the component display name. The reapply path re-applies these on top of the source-rebuilt components so local edits survive a prefab edit. Because the blob is a delta, an untouched (default) property is NOT pinned and still tracks the prefab source — this is UE's override-is-a-diff model.

CapturePrefabOverride

C++
void CapturePrefabOverride(EntityID id, const std::string& componentDisplayName, const class PrefabAsset* sourcePrefab)

Test/tooling seam: capture against an explicit prefab asset instead of resolving the entity's source path through the AssetManager.

PropagatePrefabInstance

C++
bool PropagatePrefabInstance(EntityID rootId)

Re-instantiate a placed prefab instance from its source, then replay its stored overrides — the "propagate a prefab edit to instances" path. rootId must be an instance root (prefabSourcePath set); the source prefab is resolved through the AssetManager. Returns false if the entity isn't an instance or the prefab can't be found.

SetParent

C++
void SetParent(Entity child, Entity parent)

Entity hierarchy

RemoveParent

C++
void RemoveParent(Entity child)

GetParent

C++
Entity GetParent(Entity entity) const

GetChildren

C++
std::vector<Entity> GetChildren(Entity entity) const

MoveEntityBefore

C++
void MoveEntityBefore(EntityID toMove, EntityID before)

Reorder entity in the list (for drag&drop reorder in hierarchy) Moves 'toMove' so it appears before 'before' in iteration order. If 'before' is INVALID_ENTITY, moves to the end.

GetWorld

C++
World* GetWorld()

GetWorld

C++
const World* GetWorld() const

IsLoaded

C++
bool IsLoaded() const

Scene state

IsDirty

C++
bool IsDirty() const

MarkDirty

C++
void MarkDirty()

ClearDirty

C++
void ClearDirty()

GetEnvironment

C++
SceneEnvironment& GetEnvironment()

Environment settings

GetEnvironment

C++
const SceneEnvironment& GetEnvironment() const

EvaluateVolumes

C++
void EvaluateVolumes(const Vec3& cameraPos)

Volume framework EvaluateVolumes is the per-frame hook that walks the scene's VolumeComponents, blends their profiles using cameraPos, and writes the result back into m_environment.postProcess so the existing SceneRenderer read path picks it up unchanged. Baseline handling: on the first call after scene load (or after a PostProcessBaseline reset) the current m_environment.postProcess is captured as the authored baseline. Subsequent frames blend volumes on top of that baseline. To edit the baseline live, disable all volumes (or call InvalidateVolumeBaseline) so the next evaluation captures the inspector's fresh values.

ResolveEnvironmentComponents

C++
void ResolveEnvironmentComponents()

InvalidateVolumeBaseline

C++
void InvalidateVolumeBaseline()

Forces re-capture of m_environment.postProcess as the baseline on the next EvaluateVolumes call. Editor's Volume inspector triggers this when the user nudges the scene's PP fields directly.

RebaseWorldOrigin

C++
void RebaseWorldOrigin(const Vec3& shift)

Origin rebasing. Shifts every ROOT entity transform and the physics mirror (bodies + character controllers, velocities kept) by -shift; children stay relative. Auto-triggered in OnUpdateRuntime when the main camera drifts past wp.RebaseDistance (snapped to wp.RebaseGrid). The accumulated offset maps rebased coordinates back to absolute world space: absolute = local + offset.

GetWorldOriginOffset

C++
const Vec3& GetWorldOriginOffset() const

GetNavData

C++
Ref<RefCounted> GetNavData() const

Navigation mesh (baked per scene). Null until a bake is done or a pre-baked .navmesh is loaded. NavAgentSystem reads this each tick to plan paths; with no nav mesh it falls back to straight-line steering (Scope A behavior). Opaque: the baked nav asset type lives in the AINavigation plugin, which loads the companion .navmesh on scene attach and pushes it into its nav systems (FNavMeshProvider in the plugin wraps the cast for typed callers). Core stores only the owning reference so scene lifetime keeps the bake alive.

SetNavData

C++
void SetNavData(Ref<RefCounted> data)

SetFocusHighlightProvider

C++
static void SetFocusHighlightProvider(EntityID (*provider)(World&))

Focus-highlight provider (plugin seam): the interaction system used to be named here directly; now whoever owns "what entity should the renderer highlight" registers a captureless provider. Process-wide.

EntityID

C++
static EntityID (*GetFocusHighlightProvider())(World&)

FindUnboundPlacedNetworkEntity

C++
static EntityID FindUnboundPlacedNetworkEntity(World& world, const char* prefabPath, const Vec3& position, uint64_t placedGuid)

Replication seam: the scene-placed entity a client-side Spawn packet should ADOPT instead of materializing a fresh ghost. Server and client load the same scene file, so a placed NetworkObject already exists in the client's world when its Spawn arrives — spawning a ghost on top of it is the placed-object double-spawn. placedGuid is the authored identity off the Spawn packet and settles the match on its own when both sides have it. It is 0 for a runtime spawn, a pre-v4 sender, or a scene saved before the stamp existed, and then the match falls back to what shipped before: the authored prefab path plus the nearest pose among still-unbound candidates — which pairs interchangeable twins wrongly once they have moved. Anything already bound to a NetworkId or spawned by a previous packet is never considered. INVALID_ENTITY = no candidate (dynamic spawn — the caller materializes a ghost as before).

AssignPlacedNetworkGuids

C++
uint32_t AssignPlacedNetworkGuids()

Stamp a stable identity on every scene-placed NetworkObject that lacks one, and break any collision an old copy-paste left behind. Returns how many entities were changed. Called from the save path so authoring an object is all a designer has to do; exposed because a scene assembled in code (tests, a generator) needs the same guarantee before it is hosted.

ReleaseAdoptedPlacedNetworkEntities

C++
uint32_t ReleaseAdoptedPlacedNetworkEntities()

Hand every scene-placed NetworkObject back to the scene when a session ends. networkId and spawnedRemotely are session state written onto an entity the SCENE owns, and nothing else clears them, so a placed twin a join adopted stays marked as somebody's ghost forever. The next join then skips it in FindUnboundPlacedNetworkEntity and materializes a second copy — the double-spawn adoption exists to prevent, returning through leave → rejoin. Runtime-spawned ghosts are left alone: they belong to the session, not the scene, and the reload path already discards them. Returns how many entities were released.

GetOrCreatePointCloudAccumulator

C++
FPointCloudAccumulator* GetOrCreatePointCloudAccumulator(EntityID id, const FPointCloudBudget& budget)

Scanned point clouds. The Scene owns the accumulator behind every PointCloudComponent (keyed by entity), exactly so the save path has an owner to flush: SaveToFile writes each cloud's .mpcl companion and records its path on the component before the scene is serialized, and LoadFromFile rebuilds the accumulator from that path — the same shape as the terrain flush and the nav-mesh companion. Game code asks the scene for the accumulator instead of owning one; the component's runtime pointer is a non-owning view of the scene-owned object.

GetPointCloudAccumulator

C++
FPointCloudAccumulator* GetPointCloudAccumulator(EntityID id) const

AdoptPointCloudBlob

C++
bool AdoptPointCloudBlob(EntityID id, const uint8_t* bytes, size_t size)

Replace one entity's cloud from a .mpcl blob the caller already holds. The save path restores clouds from slot-owned sidecars rather than from the component's authored cloudPath — a saved game must not write back over the scene's shipped scan, and two slots of the same level have to hold two different revealed worlds.

SaveToFile

C++
bool SaveToFile(const std::string& path)

Serialization

LoadFromFile

C++
bool LoadFromFile(const std::string& path)

IsExternalActorMap

C++
static bool IsExternalActorMap(const std::string& path)

True when a save to path splits the level: a .mmap that already is a World package (world settings in the map, one .actor per actor under __ExternalActors__/, FExternalActorFiles), or a new one in a project on the package asset format. A plain .mmap stays one file.

LoadFromDocument

C++
bool LoadFromDocument(const std::string& path, MDF::MdfDocument& doc)

The second half of LoadFromFile for a document the caller already read and parsed — on a worker, say, since the read and the parse are the part of an open that needs no world. path is what the scene remembers as its file.

GetNewerContentReason

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

Why SaveToFile will refuse this scene (empty = it will not): the load read content a newer build wrote, and saving would drop what it added.

ReloadBakedGi

C++
void ReloadBakedGi()

Loads <scene>.mgi, the baked GI fallback, into the environment (or clears it). LoadFromFile calls it; the editor calls it again after a bake.

SerializeToMDF

C++
std::string SerializeToMDF(ESceneSerializeScope scope = ESceneSerializeScope::Session) const

DeserializeFromMDF

C++
bool DeserializeFromMDF(const std::string& mdfStr)

SerializeToDocument

C++
void SerializeToDocument(MDF::MdfDocument& outDoc, ESceneSerializeScope scope = ESceneSerializeScope::Session) const

Document-level (de)serialization — no text round-trip. SaveGame and other binary paths compose/consume the scene node directly.

DeserializeFromDocument

C++
bool DeserializeFromDocument(MDF::MdfDocument& doc)

CapturePlayState

C++
void CapturePlayState(ScenePlaySnapshot& out) const

RestorePlayState

C++
bool RestorePlayState(const ScenePlaySnapshot& snapshot)

AddComponentByDisplayName

C++
bool AddComponentByDisplayName(EntityID id, const std::string& displayName)

Type-erased component add/remove by reflection display name ("Light", "Terrain", ...). Backs the editor's Add Component menu; the name→type table mirrors the reflected-serialization lists in Scene.cpp until TypeDescriptor grows factory hooks.

RemoveComponentByDisplayName

C++
bool RemoveComponentByDisplayName(EntityID id, const std::string& displayName)

MergeEntitiesFromMdf

C++
int MergeEntitiesFromMdf(const std::string& mdfStr)

Additive load: parses a serialized scene and appends its entities to this scene with *fresh* UUIDs (so two additive loads of the same MDF don't collide). Environment settings, name, and path are left untouched. Returns the number of entities successfully merged (0 if the MDF failed to parse). Parent links are resolved only within the merged set — cross-scene parenting is not supported.

SerializeEntityTreeToMdf

C++
std::string SerializeEntityTreeToMdf(EntityID rootId) const

Serialize a single entity and all its descendants as a stand-alone MDF fragment. Same per-entity encoding as SerializeToMDF — each entity becomes an Entity{} root with its saved UUID, components, and a Relationship sub-node when parented inside the tree. The *outer* parent of the root is intentionally not encoded; callers (undo for delete, copy/paste) restore that link separately.

RestoreEntityTreeFromMdf

C++
EntityID RestoreEntityTreeFromMdf(const std::string& mdfStr, const FWorldStateJournal* skipJournal = nullptr)

Inverse of SerializeEntityTreeToMdf. Recreates every entity in the fragment with its *original* UUID (so external references — saved games, replication ghosts, sibling Constraints — keep resolving), restores their components, and rewires parent links within the tree. Returns the root entity id on success or INVALID_ENTITY on parse/restore failure. Existing entities with colliding UUIDs are skipped — undo never silently merges over a live entity.

SerializeEntityStateToMdf

C++
std::string SerializeEntityStateToMdf(EntityID id, bool includeTransform = true, bool includeComponents = true) const

ApplyEntityStateFromMdf

C++
bool ApplyEntityStateFromMdf(EntityID id, const std::string& mdfStr)

SerializeEntityTreeToNode

C++
bool SerializeEntityTreeToNode(EntityID rootId, MDF::MdfNode& outTree) const

The node forms the world-state journal keeps, so a record stays a node from capture to save to overlay and is never text reparsed per entity. The tree form fills an EntityTree node, the state form one Entity.

RestoreEntityTreeFromNode

C++
EntityID RestoreEntityTreeFromNode(const MDF::MdfNode& tree, const FWorldStateJournal* skipJournal = nullptr)

SerializeEntityStateToNode

C++
bool SerializeEntityStateToNode(EntityID id, bool includeTransform, bool includeComponents, MDF::MdfNode& outEntity) const

ApplyEntityStateFromNode

C++
bool ApplyEntityStateFromNode(EntityID id, const MDF::MdfNode& entityNode)

RemapCopiedTrees

C++
static std::unordered_map<std::string, std::string> RemapCopiedTrees(const std::vector<MDF::MdfNode*>& trees)

Copy/paste and duplicate of a SET of trees (each an EntityTree node from SerializeEntityTreeToNode): one remap across the whole set, so every entity gets a fresh uuid and every parent link and actor or component reference naming another member of the set follows it to the copy. Pasting the trees one by one gave each its own remap, and a copy kept pointing at the original of anything copied beside it. Returns old uuid string -> new.

ResolveActorReferencesInTrees

C++
void ResolveActorReferencesInTrees(const std::vector<const MDF::MdfNode*>& trees)

After every tree of a set is restored: re-resolves the actor references of each restored actor, so an edge to an actor from a later tree of the set lands (a single restore resolves only within its own tree).

IsEntityRuntimeSpawned

C++
bool IsEntityRuntimeSpawned(EntityID id) const

IsEntityTransient

C++
bool IsEntityTransient(EntityID id) const

Generated content: an entity an editor-time actor made for preview. It is left out of every serialization (the level file, the Play copy, save games) and hidden from the Outliner by default. An actor's own transient flag counts too, and so does a transient parent. Neither call touches the dirty state.

SetEntityTransient

C++
void SetEntityTransient(EntityID id, bool transient)

GetWorldStateJournal

C++
FWorldStateJournal* GetWorldStateJournal() const

SerializePrefabFromEntities

C++
std::string SerializePrefabFromEntities(const std::vector<EntityID>& roots, const std::string& prefabName, std::unordered_map<EntityID, int32_t>* outIndices = nullptr, const std::string& selfSourcePath = {}) const

Author a .mdfprefab document from a live actor selection: every given root plus its descendants is written as index/parent_index Entity nodes carrying their reflected components, in the container shape PrefabAsset loads and PrefabInstantiator instantiates. A single selected root becomes the prefab root; multiple roots are collected under a synthesized group entity at the origin so the result is always single-rooted. Returns the MDF text (empty on failure). outIndices (optional) receives the entry index assigned to each serialized entity — the caller that overwrites an existing .mdfprefab needs it to restamp the instance's prefabSourceIndex values so a later propagation pairs entities with the right entries (the serializer numbers entries fresh each time). selfSourcePath: the prefab file this serialization will overwrite. Instantiated members are stamped with their source path, so without it an instance's own children read as nested instances and get written as nested_prefab references to the very file being rewritten — the instantiator's cycle guard then refuses them and the applied prefab silently loses every child. Pass empty when authoring a NEW prefab (a stamped child there is a genuinely foreign nested instance).

SetPrefabOverride

C++
void SetPrefabOverride(EntityID id, const std::string& key, const std::string& value)

Prefab override metadata (editor-only; serialized into the scene file so they survive save/reopen and source-prefab reimport). Stored as opaque MDF-string key/value pairs — the inspector encodes "Transform.position.x" → "5.0" and decodes them on apply.

GetPrefabOverride

C++
std::string GetPrefabOverride(EntityID id, const std::string& key) const

HasPrefabOverride

C++
bool HasPrefabOverride(EntityID id, const std::string& key) const

GetPrefabOverrides

C++
const std::unordered_map<std::string, std::string>* GetPrefabOverrides(EntityID id) const

ClearPrefabOverrides

C++
void ClearPrefabOverrides(EntityID id)

ForEachEntity

C++
template<typename Func> void ForEachEntity(Func&& func)

Iteration

ForEachRootEntity

C++
template<typename Func> void ForEachRootEntity(Func&& func)

Iterate only root entities (no parent)

ForEachGameObject

C++
template<typename Func> void ForEachGameObject(Func&& func)

GetEntityCount

C++
size_t GetEntityCount() const

Entity count

PreserveUnknownComponent

C++
void PreserveUnknownComponent(EntityID id, const MDF::MdfNode& node)

Passthrough for content this build cannot represent. Both are replace-by-identity so a repeated prefab reapply cannot stack duplicates onto the same entity.

PreserveUnknownActor

C++
void PreserveUnknownActor(EntityID id, const MDF::MdfNode& node)

CarryUnknownKeys

C++
void CarryUnknownKeys(EntityID id, const TypeDescriptor& desc, const MDF::MdfNode& node)

Keeps the keys of node that desc does not know for the next save, replacing what was kept for that component before.

GetPreservedComponents

C++
const std::vector<MDF::MdfNode>* GetPreservedComponents(EntityID id) const

UpdateHairStrands

C++
void UpdateHairStrands(float dt, bool simulate)

Steps (or, with simulate false, rest-poses) every Hair Strands component's guides and rebuilds its render strands. The runtime and simulate ticks call it with dynamics on, the editor tick with them off.

GetHairInstanceCount

C++
uint32_t GetHairInstanceCount() const

GetMeshRenderProxies

C++
const FMeshRenderProxyCache& GetMeshRenderProxies() const
Generated from Scene/Scene.h via game.json · Nov 5, 2026Version 1.0.0