public sealed class TerrainModeThe viewport mode the sculpt tools live in.
Remarks
The third mode, and the first whose gestures are the feature — [docs/plan/31 § Two modes, not three, and not one]. Blockout proved the seam by claiming keys that already meant something; this one claims eight of them and then spends the whole of every drag inside Pointer, because a brush is not a verb with a shortcut — it is a pointer that means something else while the mode is active.
⚠ Terrain and Foliage are two modes because they filter different things. Sculpt and paint require a terrain and act on its texels; foliage paints onto any surface and its filter set is the feature. One mode that did both would have to answer "what is the target surface" twice with different answers. Unreal splits them for this reason and it is right.
⚠ Entering the mode with no terrain shows the create panel rather than an empty toolbar. HasTerrain is what the panel reads, and the tool commands are disabled rather than hidden — a mode that does nothing and says nothing is the state every one of these toolsets puts a new user in.
Fields and properties (42)
public const string ModeIdWhat the mode is called, everywhere an id is wanted.
public const string TerrainContextThe command context the mode claims while it is active.
public const string PanelIdWhat the panel the mode opens is registered as.
public string IdWhat everything refers to it by: select, blockout.
public StringId TitleWhat the mode bar's button says.
public PathBuilder? Iconpublic IconArt? ArtColoured art for the mode's button, drawn with the title underneath.
public string? ContextWhich command context the mode claims while it is active, or .
public string? Panelpublic IReadOnlyList<ToolbarEntry> Toolbarpublic static IReadOnlyList<TerrainCategory> CategoriesThe two halves of the toolset, in the order the strip lists them.
public static IReadOnlyList<TerrainPaintTool> PaintToolsThe four paint tools, in the order the strip lists them.
public static IReadOnlyList<TerrainTool> ToolsEvery tool, in the order the strip lists them.
public TerrainEdit EditingThe editing state the mode drives.
public EditorDocument? DocumentThe document a committed stroke goes onto, or null while the mode drives none.
public Vector3 OriginWhere the terrain's sample origin is, in world space.
public float ReachHow far a pointer ray looks for the ground, in metres.
public bool HasTerrainWhether there is a terrain to sculpt.
public TerrainCreateSettings CreateThe form a new terrain is created from, which is the panel's first section.
public TerrainCategory CategoryWhich half of the toolset the digits and the strip are showing.
public TerrainPaintTool PaintToolWhich paint tool a drag runs, while the category is Paint.
public int ToolCountHow many tools the current category has, which is what the digits address.
public TerrainTool ToolWhich sculpt tool a drag runs.
public const int SlotCountHow many digits the mode claims.
public const string AddTargetCommandAdds a target layer to paint with.
public const string RemoveTargetCommandRemoves the selected one, giving its coverage back to the rest.
public static IReadOnlyList<string> TargetCommandsEvery target-layer verb, in the order the menu lists them.
public const string GrowBrushCommandMakes the brush bigger.
public const string ShrinkBrushCommandAnd smaller.
public const string HarderCommandPresses harder.
public const string SofterCommandAnd softer.
public const string CreateCommandCreates the terrain the create form describes.
public const string AddLayerCommandAdds an edit layer on top of the stack.
public const string RemoveLayerCommandRemoves the selected one.
public const string DuplicateLayerCommandCopies it, deltas and all.
public const string ClearLayerCommandEmpties it without removing it.
public const string CollapseLayerCommandAdds it into the layer below and drops it.
public const string RaiseLayerCommandMoves it up the stack.
public const string LowerLayerCommandAnd down.
public const string ToggleLayerCommandShows or hides it.
public static IReadOnlyList<string> BrushCommandsEvery brush verb, in the order the menu lists them.
public static IReadOnlyList<string> LayerCommandsAnd every layer verb.
Events (5)
public Action<IEditorCommand>? CommittedRaised when a stroke has been committed, with the entry that undoes it.
public Action<Terrain>? CreatedRaised when the mode has made a terrain, so the application can put it in a scene.
public Action<TerrainCategory>? CategoryChangedRaised when Category changes.
public Action<TerrainPaintTool>? PaintToolChangedRaised when PaintTool changes.
public Action<TerrainTool>? ToolChangedRaised when Tool changes.
Methods (14)
public bool SelectSlot(int slot)Selects the th tool of the current category, 0-based.
public static string ToolCommand(TerrainTool tool)What the command that selects a tool is called.
public static string PaintToolCommand(TerrainPaintTool tool)What the command that selects a paint tool is called.
public static string CategoryCommand(TerrainCategory category)What the command that chooses a category is called.
public static string SlotCommand(int slot)What the command bound to a digit is called.
public void Register(EditorShell shell)Puts the mode's commands, bindings and panels into the shell.
public void Unregister(EditorShell shell)Takes them back out.
public void Activated()The mode has become the active one.
public void Deactivated()public bool Pointer(PointerEvent args)public bool Key(KeyEvent args)public bool Pointer(SceneViewport pane, PointerEvent args)public bool Key(SceneViewport pane, KeyEvent args)public IEditorCommand? Commit()Ends the stroke and puts it on the document's stack.
Used by (9)
- EditorModeTestsVixen.Editor.App.Tests
- FoliageModeTestsVixen.Editor.Terrain.Tests
- SculptSessionTestsVixen.Editor.Terrain.Tests
- TerrainModeTestsVixen.Editor.Terrain.Tests
- TerrainModuleVixen.Editor.Terrain
- TerrainPaintModeTestsVixen.Editor.Terrain.Tests
- TerrainPanelTestsVixen.Editor.Terrain.Tests
- TerrainPanelTestsVixen.Editor.App.Tests
- TerrainSessionTestsVixen.Editor.App.Tests