Vixen
dd8b0a81
csharp
public sealed class TextureGraphDocument

A texture graph, open for editing.

Read the guide page for this →

Remarks

A NodeGraphAsset, exactly as a .vxshadergraph is. The file holds nodes, edges, positions and the numbers an author typed — not the images and not the plan. Doc 48 § D4 is why that is not a compromise: what a graph produces is a folder of PNGs and a .vxmat, which the content build writes and the runtime reads, so the authored graph and the baked output are two files with two lifetimes rather than one file that is both.

⚠ A new graph is a colour wired into an output, not an empty canvas, and the reason is the compiler's: a graph with no Output node produces no images at all, so a file that opened empty would report nothing to bake the first time anybody asked. One Source/Uniform into one Output/Output is the smallest graph that both compiles and shows the two moves every graph after it makes.

⚠ This used to say "nothing here compiles, because TextureGraphCompiler is internal", and that claim is false. It was true when it was written and #738 closed by making the compiler public sealed; the sentence outlived the fix, in this file and in the panel's own status line, where an author still reads it — #816. Compile is the method it said could not exist.

⚠ The registry carries published node types and the compilation carries the source that resolves them, and the two come from one call. TextureCompoundLibrary.Publish had no caller outside its own tests — #799, #803 — so doc 48 § 4.9's four shipped compounds were in the assembly, loadable, compilable and absent from every menu. A document takes both halves from Publish precisely so that they cannot come apart: a node in the search popup that the compiler cannot resolve is a TG0001 handed to the author who placed it.

⚠ The base resolution is not stored, because there is nowhere to store it. NodeGraphModel carries a name, a node list and an interface; TextureGraphCompiler.BaseWidth is a property a host sets, and its own remarks call that a gap — #719. So BaseWidth here is what the panel shows and what a bake would use, and it does not survive a save. Inventing a sidecar to hold it would be a second file that disagrees with the one #719 is going to add.

Fields and properties (8)

  • public const string Extension

    What a texture graph is written as.

  • public const string NewContents

    What an unopened .vxtexgraph is: a zero-byte file.

  • public string AssetPath

    Where the file is, absolute.

  • public NodeGraphModel Graph

    The graph.

  • public NodeTypeRegistry Registry

    The node types this document is edited against.

  • public IReadOnlyList<NodeDiagnostic> LoadDiagnostics

    What reading the file had to say — repairs, and a refusal.

  • public int BaseWidth

    The width the graph is authored at, in texels.

  • public int BaseHeight

    The height the graph is authored at.

Methods (5)

  • public TextureGraphDocument(EditorProject project, AssetId asset, string path, NodeTypeRegistry? registry = null)

    Opens a texture graph.

  • public bool Republish()

    Rebuilds the node library if a compound has been saved since it was built.

  • protected override void OnProjectFileChanged(string? path)
  • protected override void OnClosed()

    Called once when the document leaves the project.

  • protected override void SaveCore()

Used by (27)

  • ExternalCompoundTestsVixen.Editor.Texturing.Tests
  • ForceBakeDeviceTestsVixen.Editor.Texturing.Tests
  • ImageViewBarWiringTestsVixen.Editor.Texturing.Tests
  • LayerStackCompoundCacheTestsVixen.Editor.Texturing.Tests
  • LayerStackDocumentVixen.Editor.Texturing
  • LayerStackKnobWidthTestsVixen.Editor.Texturing.Tests
  • LayerStackWatchTestsVixen.Editor.Texturing.Tests
  • MaskStackTestsVixen.Editor.Texturing.Tests
  • MaterialBakeRouteVixen.Editor.Texturing
  • MaterialBakeRouteDeviceTestsVixen.Editor.Texturing.Tests
  • NodePreviewWiringTestsVixen.Editor.Texturing.Tests
  • ParallaxBakeDeviceTestsVixen.Editor.Texturing.Tests
  • PreviewLeaseTestsVixen.Editor.Texturing.Tests
  • ProjectCompoundDeviceTestsVixen.Editor.Texturing.Tests
  • TextureGraphDocumentTestsVixen.Editor.Texturing.Tests
  • TextureGraphEditorFactoryVixen.Editor.Texturing
  • TextureGraphPanelTestsVixen.Editor.Texturing.Tests
  • TextureGraphPreviewVixen.Editor.Texturing
  • TextureGraphUndoTestsVixen.Editor.Texturing.Tests
  • TextureGraphViewVixen.Editor.Texturing
  • TexturePreviewDeviceTestsVixen.Editor.Texturing.Tests
  • TexturingClaimTestsVixen.Editor.Texturing.Tests
  • TexturingCollectionTestsVixen.Editor.Texturing.Tests
  • TexturingDiagnosticIdTestsVixen.Editor.Texturing.Tests
  • TexturingFixtureVixen.Editor.Texturing.Tests
  • TexturingModuleVixen.Editor.Texturing
  • TexturingModuleTestsVixen.Editor.Texturing.Tests