Vixen
02b45cc4
csharp
public sealed class ProjectMeshSource

The geometry a scene's mesh references name, read out of the project's own import cache.

Read the guide page for this →

Remarks

AssetMeshSource's editor twin, and the reason IMeshSource is an interface. A game resolves a reference through a catalog and a bundle; the editor has neither and does not want them — it has the chunks the last import wrote, in a store on disk beside the project. Same question, two places to look, and everything above the interface is identical.

Why the editor cannot simply use the game's. A ContentCatalog is built by a content build, which is something an author runs when they ship rather than every time they open a scene. Waiting for one to look at a level would make the viewport a function of the build rather than of the files.

⚠ Synchronous, unlike every other source. The chunk is on local disk and already decompressed by the object database, so there is no load to be in flight — and an editor frame that skipped a mesh would have to re-ask, which for a viewport redrawn on demand means a mesh that appears when something else happens to cause a repaint. The protocol still allows it to answer false, which is what a missing or unreadable chunk is.

Fields and properties (2)

  • public int Requested

    How many distinct meshes have been asked for.

  • public int Loaded

    How many of them were read.

Methods (3)

  • public ProjectMeshSource(ProjectWorkspace workspace)

    Builds a source over a project.

  • public void Invalidate()

    Forgets what has been read, so a re-import is picked up.

  • public bool TryGet(AssetReference reference, out MeshData mesh)

    The mesh a reference names, if it is here yet.

Used by (2)

  • ContentTasksVixen.Editor.App
  • EditorApplicationVixen.Editor.App