Vixen
dd8b0a81
csharp
public sealed class BlockoutUvPanel

docs/plan/42 § D13's editor UV panel, as the half that runs without a device.

Read the guide page for this →

Remarks

"A UV panel: islands, distortion as a heat map, seam display, and the three verbs separately." That is the whole of the requirement and this is the whole of the state it needs: which islands there are, where each one sits, how stretched each one is, which edges are seams, and a verb apiece for chart, flatten and pack. The drawing — the atlas rectangle, the island outlines, the colour ramp — reads these and adds nothing to them.

⚠ It is not a drag-a-vertex-in-UV-space tool, and docs/plan/42's "What this does not become" item 2 says so in as many words. Every verb here replaces the whole layout; nothing moves one coordinate. Editing an island by hand is doc 20's surface and a different document, and a panel that grew one gesture in that direction would have to grow an undo model, a selection model and a snapping model with it.

⚠ The three stages are separate calls because they are separately useful. § D1: an artist who cut seams elsewhere wants those seams kept and the islands rearranged, so Pack runs on whatever Islands currently holds rather than re-deriving it — which is the same property vixen uv pack exists to expose.

⚠ A refusal leaves the previous state alone. The packer throws when the islands did not fit and could not be made to; catching it here and keeping the last good layout is what stops "I raised the margin too far" from emptying the panel.

Fields and properties (10)

  • public const float BadDistortion

    Above this stretch an island is drawn as a problem rather than as a colour.

  • public EditMesh? Mesh

    What the panel is looking at, or null.

  • public UvSettings Settings

    Where to cut and how flat to make it.

  • public PackSettings Packing

    Where the islands go.

  • public IReadOnlyList<int> Charts

    One chart index per face, or empty before Chart has run.

  • public IReadOnlyList<UvIsland> Islands

    The flattened islands, or empty before Flatten has run.

  • public IReadOnlyList<UvPlacement> Placements

    Where the packer put each island, or empty before Pack has run.

  • public IReadOnlyList<UvIslandView> Views

    What to draw: one entry per island, in the atlas's coordinates.

  • public UvReport Report

    The last report any stage produced.

  • public IReadOnlyList<string> Messages

    What to show a person about the last thing that ran.

Events (1)

  • public Action<BlockoutUvPanel>? Changed

    Raised whenever anything above changed, so a view can redraw.

Methods (5)

  • public bool Chart()

    Runs the charting stage: where to cut.

  • public bool Flatten()

    Runs the flattening stage over the current charts, charting first if it has to.

  • public bool Pack()

    Runs the packing stage over the current islands, flattening first if it has to.

  • public IReadOnlyList<(Vector3 A, Vector3 B)> Seams()

    Every edge the current charting cut, as pairs of positions.

  • public static float Heat(in UvIslandView view)

    The heat map's ramp position for an island, in [0, 1].

Used by (5)

  • BlockoutModuleVixen.Editor.Blockout
  • BlockoutRetopologyTestsVixen.Editor.Blockout.Tests
  • BlockoutUvViewVixen.Editor.Blockout
  • BlockoutUvViewTestsVixen.Editor.Blockout.Tests
  • UvIslandViewVixen.Editor.Blockout