Orrery Terrain · OrreryTerrainEditor module · class
FOrreryTerrainAuthoringSync
Editor onlyThe editor's authoring sync: the live terrain of an editor world is the truth, and its authoring asset catches up at four moments: the asset's own save, the map's save, PIE start and a terrain re-create (Material, Source, undo of a recreate property).
Declaration
class FOrreryTerrainAuthoringSync- Header
#include "Persist/OrreryTerrainAuthoringSync.h"- Module
PublicDependencyModuleNames.Add("OrreryTerrainEditor");in an editor module’s Build.cs: an editor module, not in packaged games.- Stability
- Stable: changes within a major version only add.
- Thread
- Game thread, editor only.
Description
A map closing never captures, so closing without saving keeps the asset as it was.
Dirty: a sculpt, paint, feature or undo in a tracked editor world (OnGroundChanged with cause Commit, Undo, or Sculpt) marks the world dirty; a restore (Load), streaming and extension writes do not. The next frame marks the asset's package dirty (never inside an undo, where the engine refuses it), so Save All asks.
The asset:
<Map>_TerrainAuthoringbeside the map, or in Project Settings > Orrery Terrain Editor > Authoring Folder. It is made on the first edit of a saved map. An unsaved map keeps a transient asset, which the map's first save replaces with the real one.Saving the map captures into the asset before the map is written and saves the asset after it, as the engine saves a map's built data. An autosave captures and leaves the asset to the autosaver.
Undo: the sync names its asset on the actor outside any transaction, so an undo of an older actor transaction can bring back the reference it replaced. The re-create that follows keeps the sync's asset, which holds the live state just captured, instead of restoring the older one.
The cook logs an Error, Warning or nothing (
UOrreryTerrainEditorSettings::UnbakedCook) for each terrain actor whose authoring asset holds a payload: the cook drops the asset, so the cooked game lacks the authored ground. An Error makes the cook commandlet exit non-zero. The map check warns too.
Game thread, editor only. One instance, owned by the editor module (Startup, Shutdown). Commandlets track no world: their worlds create no editor terrain.
Functions
- Getstatic
The module's instance.
- Startup
Bind the engine's world, save, PIE and map check events, and track the editor worlds that already exist.
- Shutdown
Unbind everything and forget every world.
- IsDirty
True when World's editor terrain holds edits its authoring asset does not have yet.
- GetBoundAsset
The asset World's live terrain is kept in (restored from at creation, or captured into since); null if none yet.
- Flush
Capture World's editor terrain into its authoring asset if it is dirty, making the asset when there is none: the real one for a saved map, a transient one otherwise.
- MakeAuthoringPackageNamestatic
The package name of World's authoring asset:
<Authoring Folder, or the map's folder>/<Map>_TerrainAuthoring. - CheckCookstatic
The cook check for one actor.