public sealed class MaterialViewA material, open for editing: a preview, what it is drawn with, and what it sets.
No guide page documents this yet — the page shows what the code says about itself.
Remarks
⚠ The preview is a request, not a renderer. Drawing a lit sphere needs a device, a compositor and a compiled effect, none of which this assembly has — so the view owns the Shape and the Preview image, raises PreviewChanged when either the shape or the material moves, and the application renders into a target and puts its number on the image. The same split the scene panel and the texture editor already have.
The shader-graph link is a button and a state. A material naming a graph offers "Open graph"; one that names a graph the project no longer has says so rather than offering a button that opens nothing. What happens when it is pressed is the shell's — OpenGraphRequested carries the asset, and the registry is what turns an asset into a document.
Fields and properties (12)
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 Image PreviewWhere the preview is drawn once something has rendered it.
public MaterialPreviewShape ShapeWhich shape the preview asks for.
public Select ShapesThe shape picker.
public InspectorView HeaderViewThe shader, the shading model and the graph link.
public Button OpenGraphThe button that opens the graph this material came from.
public UiElement ParametersWhat the material sets, one expander a parameter.
public Select NewKindWhich kind of parameter the add button will add.
public TextBox NewNameWhat the new parameter will be called.
public Button AddParameterThe button that adds it.
public Alert BrokenShown when the file did not read.
Events (2)
public Action<MaterialView>? PreviewChangedRaised when the preview's subject changes — a different shape, or an edited value.
public Action<MaterialView, AssetId>? OpenGraphRequestedRaised when the author asks for the shader graph this material was authored in.
Methods (4)
protected override void OnCreated()Builds whatever this element is made of, once, as it joins a document.
public void Show(MaterialDocument material)Shows a material.
public void Rebuild()Rebuilds the parameter list from the material as it stands.
public void Reload()Reads every editor back from the material, without rebuilding anything.
Used by (4)
- EditorApplicationVixen.Editor.App
- EditorViewTestsVixen.Editor.AssetEditors.Tests
- MaterialEditorFactoryVixen.Editor.AssetEditors
- MaterialTestsVixen.Editor.AssetEditors.Tests