Vixen
02b45cc4
csharp
public sealed class ShapeCommand

One undoable change to a parametric shape: its numbers, or the loss of them.

Read the guide page for this →

Remarks

Doc 24's D6 on the undo stack, and it records no geometry at all. A parametric entity's mesh is a function of its parameters, so putting the parameters back is what puts the mesh back — exactly, and for four numbers rather than for a copy of the mesh. That is the one place this differs from EditMeshCommand, which has to record whole meshes because a topology change has no inverse.

⚠ Demoting records nothing either, and leaves the geometry exactly where it is. The mesh a shape generated is already in the document; taking the parameters away changes nothing about it. An undo puts them back and regenerates — which produces the same mesh, because nothing has edited it yet: the first edit is its own entry on the stack and is undone first.

⚠ Two parameter edits of one shape merge and two of different shapes do not. Dragging a corridor's width field is one decision made over forty frames, and forty entries for it is the shape of every "undo did not undo what I did" report — the same argument EditMeshCommand makes about a gizmo drag. A demotion never merges with anything, because it is a different kind of act and one people are entitled to step back over on its own.

Fields and properties (3)

  • public string Name

    What this is called in the undo history, as a person would say it.

  • public bool IsDemotion

    Whether this is the one-way door rather than a change of numbers.

  • public Entity Entity

    Which entity's shape it changes.

Methods (5)

Used by (5)

  • BlockoutBooleanVixen.Editor.Blockout
  • BlockoutCreateVixen.Editor.Blockout
  • BlockoutHandoffVixen.Editor.Blockout
  • MeshEditVixen.Editor.SceneView
  • SceneCloneVixen.Editor.SceneView