Vixen
dd8b0a81
csharp
public record class SettingDefinition

One of a node type's settings: a name it was given rather than a value it was wired.

Read the guide page for this →

Remarks

⚠ Deliberately not a PortDefinition with a tenth PortKind. A setting has no direction, no socket and no edge — see SettingAttribute — and folding it into the port list would mean every consumer that walks ports had to remember which of them could not be connected to.

⚠ The last four exist because a published graph's parameters lost them crossing this boundary — #730. Doc 48 § D9 says an exposed parameter is "a name, a type, a default, a range and a group"; three of the five fitted here, so a parameter declared 0…1 drew as a text box and a bool one drew as a box in which ture is a value. The workaround was folding the range into the Summary, which put it in a tooltip and nowhere a row could act on.

Every one of them is optional and the record's old three-argument shape still compiles, which is what keeps a setting that is genuinely a name — a menu path, an expression, an asset reference — exactly as cheap to declare as it was.

⚠ Accepted is the fifth, and it exists because a set of legal names had no way across this boundary at all — #964. A node whose setting is one of nine measurements said so in its Summary prose and in the sentence it refuses a tenth with, and every consumer that wanted to offer the nine — the node inspector, a plugin's own panel — had to write them down again. Five exact-equality roll calls in this workstream have gone red on a second transcription of a known set, and a picker that disagrees with the compiler's refusal is worse than a text box, because the disagreement is silent in the direction the author cannot see.

Fields and properties (10)

  • public string Name

    What it is called, and the key it is stored under in Texts.

  • public string Default

    What it says when the author has not said anything.

  • public string Summary

    One line saying what it means.

  • public SettingKind Kind

    How its text is read.

  • public float Minimum

    The bottom of its range, or negative infinity for none.

  • public float Maximum

    The top of it, or positive infinity for none.

  • public string Group

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

  • public ImmutableArray<string> Accepted

    Every value this setting may hold, in declaration order, or empty for any name.

  • public bool IsBounded

    Whether this setting is edited between two stated numbers.

  • public bool IsChoice

    Whether this setting is chosen from a stated list rather than typed.

Methods (3)

  • public SettingDefinition(string Name, string Default = "", string Summary = "", SettingKind Kind = Text, float Minimum = -Infinity, float Maximum = Infinity, string Group = "", ImmutableArray<string> Accepted = default(ImmutableArray<string>))

    One of a node type's settings: a name it was given rather than a value it was wired.

  • public bool Accepts(string value)

    Whether a written value is one this setting accepts.

  • public string Canonical(string value)

    The spelling this setting states for a written value.

Used by (24)

  • GraphDeclarationTestsVixen.Editor.NodeGraph.Tests
  • GraphDocumentTestsVixen.Editor.NodeGraph.Tests
  • LayerStackViewVixen.Editor.Texturing
  • MaterialBakeRouteVixen.Editor.Texturing
  • NodeGraphCompilerVixen.Editor.NodeGraph
  • NodeGraphDocumentVixen.Editor.NodeGraph
  • NodeGraphModelVixen.Editor.NodeGraph
  • NodePortEditProviderVixen.Editor.NodeGraph
  • NodeSettingMemberVixen.Editor.NodeGraph
  • NodeTypeDefinitionVixen.Editor.NodeGraph
  • NodeTypingTestsVixen.Editor.NodeGraph.Tests
  • SettingAcceptanceTestsVixen.Editor.NodeGraph.Tests
  • SubGraphTestsVixen.Editor.NodeGraph.Tests
  • TextureCompoundNameKnobRollCallTestsVixen.Editor.TextureGraph.Tests
  • TextureGraphDeclarationTestsVixen.Editor.TextureGraph.Tests
  • TextureGraphNameKnobTestsVixen.Editor.TextureGraph.Tests
  • TextureGraphParameterTestsVixen.Editor.TextureGraph.Tests
  • TextureGraphParametersVixen.Editor.TextureGraph
  • TextureGraphRunnerVixen.Cli
  • TextureGraphSubGraphTestsVixen.Editor.TextureGraph.Tests
  • TextureMeshMapsVixen.Editor.TextureGraph
  • TextureNodeLibraryVixen.Editor.Texturing
  • TextureSettingChoiceTestsVixen.Editor.TextureGraph.Tests
  • TextureUsagesVixen.Editor.TextureGraph