Vixen
02b45cc4
csharp
public sealed class FoliageStrokeCommand

One foliage stroke as one entry in the undo history.

Read the guide page for this →

Remarks

The third stroke command, and the one whose record is instances rather than a rectangle. A sculpt stroke holds a rect of deltas and a paint stroke holds a rect of weights, because both write a grid; a foliage stroke writes a list, so what it holds is what it added and what it took away.

⚠ Redo re-adds rather than re-scattering, and that is not the same thing. The scatter is deterministic from its seed, so re-running it would produce the same trees — but only if nothing else changed in between, and an undo stack does not promise that. Somebody who erased a clearing, undid it, then undid the stroke before it, has changed what the spacing rejection sees. Holding the instances is the only version that is exact.

⚠ Addresses do not survive the round trip and the command does not pretend they do. Undoing a stroke removes what it added, which shifts every index after it; the re-add produces new addresses. So the command works in instances and the editor re-resolves its selection after any edit.

Fields and properties (3)

  • public string Name

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

  • public int Added

    How many instances the stroke added.

  • public int Removed

    And how many it took away.

Methods (3)

Used by (2)

  • FoliageEditVixen.Editor.Terrain
  • FoliageModeVixen.Editor.Terrain