Vixen
dd8b0a81
csharp
public record class TextureGraphParameter

One knob a published graph has: doc 48 § D9's [Setting]-shaped parameter.

Read the guide page for this →

Remarks

A name, a type, a default, a range and a group — doc 48 § D9's list exactly. The range is not decoration: it is what an inspector draws a slider between, and it is what Read refuses an override outside, because a parameter whose declared range says 0…1 and whose value is 40 is a graph whose author has been lied to about what it does.

⚠ The range crosses to the framework now rather than being described to it — #730, closed. A SettingDefinition was a name, a default and a summary, so Settings folded the group and the two numbers into the summary and an inspector drew a parameter declared 0…1 as a text box with a helpful tooltip. It carries a kind, a range and a group of its own now. This record is still what enforces the range, because refusing a value is a compiler's job and a slider's bounds are a courtesy.

⚠ Two defaults, one per half of TextureGraphParameterKind, and that is a shape worth being uncomfortable about. Default is a number and Choice is a name; a Name parameter reads the second and every other kind reads the first. Folding them into one member would mean parsing a name out of a float or a float out of a name at every use, and Check is what stops the unread one from being set to something that reads as a disagreement.

Fields and properties (10)

  • public string Name

    Its name, which is what an expression spells and what a containing graph stores. It has to be a Raven identifier — see Check.

  • public TextureGraphParameterKind Kind

    Its type.

  • public float Default

    What it is worth when nobody overrides it.

  • public float Minimum

    The bottom of its range.

  • public float Maximum

    The top of it.

  • public string Group

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

  • public string Summary

    One line saying what it means.

  • public string Choice

    What a Name parameter is worth when nobody overrides it. Ignored by every other kind, which defaults through .

  • public ImmutableArray<string> Accepted

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

  • public bool IsChoice

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

Methods (5)

  • public TextureGraphParameter(string Name, TextureGraphParameterKind Kind = Scalar, float Default = 0, float Minimum = -Infinity, float Maximum = Infinity, string Group = "", string Summary = "", string Choice = "", ImmutableArray<string> Accepted = default(ImmutableArray<string>))

    One knob a published graph has: doc 48 § D9's [Setting]-shaped parameter.

  • public string Canonical(string value)

    The spelling this parameter states for a written name.

  • public bool Holds(float value)

    Whether a value is inside the declared range.

  • public string RavenLiteral(float value)

    How this parameter's value is spelled in Raven.

  • public string Text(float value)

    How an author's override of it is spelled in a saved graph.

Used by (13)

  • ITextureGraphLibraryVixen.Editor.TextureGraph
  • TextureCompoundNameKnobRollCallTestsVixen.Editor.TextureGraph.Tests
  • TextureDiagnosticIdTestsVixen.Editor.TextureGraph.Tests
  • TextureExpressionCostTestsVixen.Editor.TextureGraph.Tests
  • TextureGraphCompilerVixen.Editor.TextureGraph
  • TextureGraphDeclarationTestsVixen.Editor.TextureGraph.Tests
  • TextureGraphExpressionsVixen.Editor.TextureGraph
  • TextureGraphLibraryVixen.Editor.TextureGraph
  • TextureGraphNameKnobTestsVixen.Editor.TextureGraph.Tests
  • TextureGraphParameterTestsVixen.Editor.TextureGraph.Tests
  • TextureGraphParametersVixen.Editor.TextureGraph
  • TextureGraphSubGraphTestsVixen.Editor.TextureGraph.Tests
  • TexturePixelProcessorTestsVixen.Editor.TextureGraph.Tests