Vixen
dd8b0a81
csharp
public interface IMeshMapBaker

Something that can bake a mesh's maps into the project and say what assets they became.

Read the guide page for this →

Remarks

The seam doc 24's IMeshBaker established, for doc 48 § D12's maps. Same bargain and deliberately not a second arrangement: the thing that wants a bake says what it wants, and the application, which owns the asset database, answers. A panel or a plugin that knew how to mint a GUID would be the coupling doc 11's layering exists to prevent, and there is exactly one implementation of this because there is exactly one asset database.

⚠ It returns references rather than paths, keyed by usage. § 4.8's Mesh Map Input binds by usage — that is what makes one generator compound work on every mesh — so the answer is shaped like the question. A path would be a fact about today, which is doc 08's whole argument.

⚠ One method, and there used to be two — #972. A Bake that measured and wrote in one call sat here for four batches with three callers, all of them test classes: the editor's own path is ContentTasks.BakeMeshMaps, which runs MapBaker.Bake on the pool and calls Write on the frame thread, because the arithmetic takes the minutes and the write is what touches Assets/. On a contract handed to a third party the convenience was a hazard rather than a kindness: a plugin calling the synchronous both-halves form from the frame thread stalls the editor for the length of a 4K bake and nothing in its signature said so. It lives in the test assembly now, which is where all of its callers already were.

⚠ What comes back is an ordinary project asset and not a cache. § D12 is explicit: an artist opens the curvature map when a generator misbehaves, and a build wants not to re-bake it. Both of those need a file in Assets/ with a sidecar beside it, which is the difference between this and writing the same pixels into Library/.

Methods (1)

  • MeshMapSet Write(AssetId model, string mesh, IReadOnlyList<MeshMapImage> images, IReadOnlyList<string> warnings, bool force = false)

    Puts maps that have already been baked into the project.

Used by (5)

  • ContentTasksVixen.Editor.App
  • EditorApplicationVixen.Editor.App
  • MeshMapBakesVixen.Editor.App.Tests
  • ProjectMeshMapBakerVixen.Editor.App
  • RecordingBakerVixen.Editor.App.Tests