Vixen
dd8b0a81
csharp
public sealed class SettingAttribute

Marks a field as one of a node's settings.

Read the guide page for this →

As a annotation

Valid on
Field

Remarks

A setting is not a port, and that is the whole distinction. A port's value is one to four floats, it has a socket, and an edge may arrive at it and replace what was typed. A setting is a name the node was given: a custom attribute, a render target, a stage. Nothing connects to one, nothing computes one, and there is no float encoding of a name that is not an index into a table somebody has to keep.

⚠ Which is why it is a third attribute rather than a tenth PortKind. A port kind that cannot be wired would put a socket on the canvas that refuses every wire dropped on it, and CompositorNode declined to teach the generator one for exactly that reason. What was missing was not the storage — Texts and Text have held names since the compositor needed them — but a declaration, so that a node's names are described by its type the way its ports are and every graph does not have to invent a settings list of its own.

The field's type has to be . Not a port value type: a setting holds what the author typed rather than an expression to interpolate, so wrapping it would be a struct whose only member is the string it already is.

Settings are edited in the panel beside the canvas — see NodePortEditProvider — and not on the node. A node clips its own contents, so a row on one has a width a name does not fit in; the compositor's settings have always been drawn in a side panel for the same reason.

Fields and properties (9)

  • public string Name

    What the setting is called, if not the field's own name.

  • public string Summary

    One line saying what it means.

  • public string Default

    What it says when the author has not said anything.

  • public SettingKind Kind

    How its text is read: a name, a flag, a count or a number.

  • public float Minimum

    The bottom of its range, for a Int or a Float.

  • public float Maximum

    The top of it.

  • public string Group

    Which section of an inspector it belongs to, or empty for the ungrouped ones.

  • public string[] Accepted

    Every value this setting may hold, or empty when it may hold any name.

  • public Type? AcceptedFrom

    The enum whose member names are every value this setting may hold.

Used by (27)

  • BitmapNodeVixen.Editor.TextureGraph
  • BlendNodeVixen.Editor.TextureGraph
  • ChannelShuffleNodeVixen.Editor.TextureGraph
  • CropNodeVixen.Editor.TextureGraph
  • CurveNodeVixen.Editor.TextureGraph
  • DistanceNodeVixen.Editor.TextureGraph
  • FloodFillNodeVixen.Editor.TextureGraph
  • GradientMapNodeVixen.Editor.TextureGraph
  • GradientNodeVixen.Editor.TextureGraph
  • MeshMapInputNodeVixen.Editor.TextureGraph
  • MetalReflectanceNodeVixen.Editor.TextureGraph
  • MirrorNodeVixen.Editor.TextureGraph
  • MixNodeVixen.Editor.TextureGraph
  • NoiseNodeVixen.Editor.TextureGraph
  • OutputNodeVixen.Editor.TextureGraph
  • PixelProcessorNodeVixen.Editor.TextureGraph
  • ResampleNodeVixen.Editor.TextureGraph
  • RibbonOutputNodeVixen.Editor.VfxGraph
  • ShapeNodeVixen.Editor.TextureGraph
  • SlopeBlurNodeVixen.Editor.TextureGraph
  • SplatterNodeVixen.Editor.TextureGraph
  • TestChoiceNodeVixen.Editor.NodeGraph.Tests
  • TestSettingNodeVixen.Editor.NodeGraph.Tests
  • TileSamplerNodeVixen.Editor.TextureGraph
  • Transform2DNodeVixen.Editor.TextureGraph
  • TriplanarNodeVixen.Editor.TextureGraph
  • VfxCustomNodeVixen.Editor.VfxGraph