public static class TerrainLayerCommandsAdding, removing and reordering an edit layer, as one undo entry each.
Remarks
The edit-layer stack panel's verbs — [docs/plan/31 § The terrain panel]. Every one of them changes what the composite is, so every one of them invalidates the whole terrain: reordering commutes for the sums and not for the clamp at the top of the height range, which is MoveLayer's own remark and is why none of these tries to be clever about which tiles moved.
⚠ A removed layer is held by its command, not rebuilt from a name. AddLayer makes an empty layer, so an undo built on it would put back the name and none of the ground. InsertLayer exists for this and nothing else.
Methods (14)
public static (IEditorCommand Command, TerrainEditLayer Layer) Add(Terrain terrain, string name)Adds a layer on top of the stack.
public static IEditorCommand Remove(Terrain terrain, TerrainEditLayer layer)Removes a layer and everything on it.
public static (IEditorCommand Command, TerrainEditLayer Layer) Duplicate(Terrain terrain, TerrainEditLayer layer)Copies a layer, deltas and all, and puts the copy above it.
public static IEditorCommand Move(Terrain terrain, int from, int to)Moves a layer up or down the stack.
public static IEditorCommand Clear(Terrain terrain, TerrainEditLayer layer)Empties a layer without removing it.
public static IEditorCommand Collapse(Terrain terrain, int index)Adds a layer's deltas into the one below it and drops the layer.
public static IEditorCommand Rename(Terrain terrain, TerrainEditLayer layer, string name)Renames a layer.
public static IEditorCommand SetVisible(Terrain terrain, TerrainEditLayer layer, bool visible)Shows or hides a layer.
public static IEditorCommand SetLocked(Terrain terrain, TerrainEditLayer layer, bool locked)Locks a layer against the brush, or unlocks it.
public static IEditorCommand SetHeightAlpha(Terrain terrain, TerrainEditLayer layer, float alpha)Changes how much of a layer's heights reach the composite.
public static IEditorCommand SetWeightAlpha(Terrain terrain, TerrainEditLayer layer, float alpha)And how much of its paint does.
public static (IEditorCommand Command, int Index) AddTarget(Terrain terrain, string name)Adds a target layer to paint with.
public static IEditorCommand RemoveTarget(Terrain terrain, int index)Removes a target layer, giving its coverage back to the rest.
public static IEditorCommand AssignTarget(Terrain terrain, int index, TerrainLayerDescription description)Changes what ground a target layer paints.
Used by (4)
- SculptSessionTestsVixen.Editor.Terrain.Tests
- TerrainLayerCommandTestsVixen.Editor.Terrain.Tests
- TerrainModeVixen.Editor.Terrain
- TerrainPaintModeTestsVixen.Editor.Terrain.Tests