Vixen
02b45cc4
csharp
public sealed class BlockoutMode

The viewport mode the grey-boxing tools live in.

Read the guide page for this →

Remarks

The second mode, and the one doc 20's IEditorMode was written for. A1 asks for the interface to ship with one mode so the seam is proven; doc 24's B2 is the argument that a seam with one implementation is a hypothesis, and that blockout is what turns it into a consumer — because it needs first refusal on viewport input, its own toolbar, and a claim on keys that already mean something.

⚠ So far it owns its keys and nothing else, and that is doc 24's P0 exactly. There is no editable mesh in the engine yet — Core/Vixen.Geometry is P1 — so Element is a statement about what a click would select rather than something that selects it, and Pointer declines every event. What is real is the arbitration: while this mode is active 1, 2, 3 and 4 in the viewport are the element modes, and while it is not they are view-bookmark recall. That is the thing that could not be retrofitted, and it is the thing this mode is here to prove.

⚠ The element commands are registered whether or not the mode is active, and scoped so that they are only reachable while it is. Registering them from Activated would keep them out of the keybinding editor and out of the palette until somebody had entered the mode once, which is how a rebindable shortcut becomes undiscoverable.

Fields and properties (80)

  • public const string ModeId

    What the mode is called, everywhere an id is wanted.

  • public const string BlockoutContext

    The command context the mode claims while it is active.

  • public string Id

    What everything refers to it by: select, blockout.

  • public StringId Title

    What the mode bar's button says.

  • public PathBuilder? Icon
  • public IconArt? Art

    Coloured art for the mode's button, drawn with the title underneath.

  • public string? Context

    Which command context the mode claims while it is active, or .

  • public string? Panel
  • public IReadOnlyList<ToolbarEntry> Toolbar
  • public BlockoutElement Element

    What a click in the viewport would select.

  • public MeshEdit? Editing

    The editing state the mode drives, or when it drives none.

  • public ShapeDrag? Drag

    The shape-tool gesture, or null while the mode drives no scene.

  • public const string ToggleMeshCommand

    The command that enters and leaves the mesh.

  • public const string SelectLoopCommand

    Selects the edge loop through the active edge.

  • public const string SelectRingCommand

    Selects the edge ring through it.

  • public const string GrowCommand

    Takes in everything touching the selection.

  • public const string ShrinkCommand

    Gives back everything on its rim.

  • public const string SelectGroupCommand

    Selects every face in the active face's group.

  • public const string SelectCoplanarCommand

    Selects every face coplanar with and joined to it.

  • public const string SelectLinkedCommand

    Selects every face joined to it.

  • public const string SelectAllCommand

    Selects every element of the current mode.

  • public const string SelectNoneCommand

    Deselects everything.

  • public const string InvertCommand

    Selects what is not selected.

  • public const string ExtrudeCommand

    Pulls the selected faces out along their normal.

  • public const string ExtrudeIndividualCommand

    Ditto, one face at a time.

  • public const string InsetCommand

    Shrinks them towards their own centre.

  • public const string InsetIndividualCommand

    Ditto, one face at a time.

  • public const string BevelCommand

    Cuts the corner off the selected edges.

  • public const string LoopCutCommand

    Puts a loop across the ring the active edge is part of.

  • public const string SubdivideCommand

    Splits the selected faces into one face per corner.

  • public const string BridgeCommand

    Joins two selected faces with a tube.

  • public const string FillCommand

    Puts a face across a hole.

  • public const string FlipCommand

    Turns the selected faces inside out.

  • public const string WeldCommand

    Merges the selected positions into one.

  • public const string DissolveCommand

    Removes the selected edges and keeps the surface.

  • public const string DeleteCommand

    Removes the selected faces, leaving a hole.

  • public const string DetachCommand

    Takes the selected faces out into an entity of their own.

  • public const string ShapeToolCommand

    Arms the shape tool, so a drag on the work plane makes geometry.

  • public const string CreateShapeCommand

    Makes one of the current shape at its default size, at the work plane's origin.

  • public const string CubeGridCommand

    Puts a box on the lattice at the work plane's origin.

  • public const string PushOutCommand

    Pushes the selected box's far side out by a cell, and its near side with Shift.

  • public const string PushInCommand

    And pulls it in.

  • public const string DuplicateCommand

    Copies what is selected.

  • public const string MirrorCommand

    Reflects a copy of it across the work plane.

  • public const string ArrayCommand

    Repeats it along a line.

  • public const string RadialCommand

    Repeats it round a circle.

  • public const string ProjectWorldCommand

    Projects the selected faces' texture coordinates in world space.

  • public const string ProjectBoxCommand

    Ditto in the object's own space.

  • public const string FitUvCommand

    Stretches each selected face's coordinates to cover one repeat.

  • public const string SmoothCommand

    Puts the selected faces in a smoothing group.

  • public const string HardenCommand

    Takes them out of one.

  • public const string AutoSmoothCommand

    Groups the whole mesh's faces by how sharply they meet.

  • public const string NewGroupCommand

    Puts the selected faces in a face group of their own.

  • public const string UnionCommand

    Everything in either of the selected solids, as a derived result.

  • public const string SubtractCommand

    The first selected solid, less the rest.

  • public const string IntersectCommand

    Only what all the selected solids share.

  • public const string ApplyBooleanCommand

    Collapses a derived result into a plain mesh and deletes its operands.

  • public const string PlaneCutCommand

    Cuts the selection with the work plane and keeps the near half.

  • public const string TrimCommand

    Cuts the first selected solid by the second's surface.

  • public const string BakeCommand

    Writes the selection into a mesh asset and points the entity at it.

  • public const string EditableCommand

    Makes an entity's mesh asset editable again.

  • public const string ExportObjCommand

    Writes the selection out as a Wavefront OBJ.

  • public const string ExportGltfCommand

    Ditto as a glTF.

  • public static IReadOnlyList<string> BooleanCommands

    Every boolean and cut, in the order the menu lists them.

  • public static IReadOnlyList<string> HandoffCommands

    And every handoff verb.

  • public static IReadOnlyList<string> CreationCommands

    Every creation verb, in the order the menu lists them.

  • public static IReadOnlyList<string> SurfaceCommands

    And every surface verb.

  • public static IReadOnlyList<string> GeometryCommands

    Every geometry verb, in the order the menu lists them.

  • public float Step

    How far a verb run from the keyboard moves geometry, in the mesh's own space.

  • public int BevelSegments

    How many faces across a bevel run from the keyboard is.

  • public ShapeKind Shape

    Which shape the shape tool makes.

  • public bool IsArmed

    Whether a drag on the work plane makes a shape rather than starting a rubber-band.

  • public WorkPlane? Plane

    The work plane shapes are dragged on, or for the ground.

  • public static IReadOnlyList<string> SelectionCommands

    Every command the mode registers, in the order the menu lists them.

  • public float UvScale

    How many world units one repeat of a texture covers, for the projection verbs.

  • public int Copies

    How many copies an array verb makes.

  • public IMeshBaker? Baker

    What puts a baked mesh into the project, or null while nothing can.

  • public IMeshSource? Meshes

    Where a mesh reference's geometry comes from, for making one editable again.

  • public Action<string, string>? Export

    What to do with an exported file: its text and its extension.

  • public static IReadOnlyList<ShapeKind> Kinds

    Every shape the tool can make, in the order a menu should offer them.

Events (1)

Methods (11)

  • public static MeshElementKind? Kind(BlockoutElement element)

    Which element kind an element mode means to the kernel.

  • public static string ElementCommand(BlockoutElement element)

    What the command that selects an element mode is called.

  • public static string KindCommand(ShapeKind kind)

    What the command that creates a shape of a kind 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)

Used by (4)

  • BlockoutModeTestsVixen.Editor.Blockout.Tests
  • BlockoutModuleVixen.Editor.Blockout
  • BlockoutSelectionTestsVixen.Editor.Blockout.Tests
  • EditorModeTestsVixen.Editor.App.Tests