public sealed class ShaderGraphViewA shader graph, open for editing: the canvas, the generated Raven, and what it said.
No guide page documents this yet — the page shows what the code says about itself.
Remarks
Doc 11's row for this asset is a node graph with "show generated code", and the three columns here are that: the canvas, which is NodeGraphView's and is already undoable in every gesture; the emitted shader, in a read-only CodeEditor with the same Raven highlighting the shader editor uses; and the selected node's settings with the compile's complaints under them.
⚠ The generated source is read-only and hidden until asked for. Editing it would be editing an artefact — the next compile overwrites it, so a panel that let you type into it would be one that quietly threw work away. Hidden by default because a graph is what the author is looking at; the toggle is what doc 07 calls "show generated code", and it is beside the button that produces it rather than in a menu.
⚠ Two lists of complaints, drawn as one. The graph compiler's name a node, Raven's name a line of the generated text, and an author wants to know about both without being asked to look in two places. Which kind each is stays visible in the stage column — graph against one and raven against the other — because the action they call for is different: one is a wire, the other is a bug in this editor.
⚠ A property node's name is edited here rather than in the node inspector. The inspector draws ports, and a property's name is not one — it names a binding, so it is a graph text. The row writes through SetPortTextCommand for the reason every other field in this assembly does: typing a name is one undo entry, not one per keystroke.
Fields and properties (13)
protected override string TagNameThe element name this type answers to when a caller does not choose one.
protected override bool AcceptsFocusWhether the focus can rest on this kind of control at all.
public NodeGraphView GraphViewThe canvas.
public UiElement PaneThe pane the emitted shader is shown in.
public CodeEditor GeneratedThe emitted shader, read-only.
public UiElement SideThe column beside the canvas.
public Button BuildThe button that compiles the graph.
public ToggleButton ShowCodeThe toggle that shows the generated Raven.
public NodeInspector SettingsThe selected node's settings.
public UiElement PropertyRowWhere the selected property node's name is edited.
public TextBox? PropertyNameThe box that renames it, or when nothing named is selected.
public UiElement PropertiesWhat the emitted shader declares.
public UiElement DiagnosticsWhat compiling said.
Methods (5)
protected override void OnCreated()Builds whatever this element is made of, once, as it joins a document.
public void Show(ShaderGraphDocument shader)Shows a graph.
protected override void OnRemoved()public int Compile()Compiles the graph, shows the Raven it emitted, and lists what was said.
public void Restate()Rebuilds the row that renames whatever property node is selected.
Used by (3)
- ShaderGraphEditorFactoryVixen.Editor.AssetEditors
- ShaderGraphSurfaceTestsVixen.Editor.App.Tests
- ShaderGraphViewTestsVixen.Editor.AssetEditors.Tests