public sealed class ProjectMeshBakerPuts a baked block-out mesh into the project and says what asset it became.
Remarks
Doc 24's P7 bake, application side. IMeshBaker is the seam Vixen.Editor.SceneView declares and this is the half that knows about the asset database — the same arrangement IMeshSource, ISurfaceSource and ISceneWriter already have.
⚠ Written as an OBJ, which the existing model importer already reads. The plan asks for the bake to go "through the existing importer machinery", and that machinery is ModelImporter — so the baked file is the same file the artist opens, compiled by the same path as anything they hand back. A mesh format of the editor's own would have been a second compiler to keep in step with the first, for geometry whose whole purpose is to be replaced.
⚠ A scan rather than an import, and the difference is what mints the identity. A file in Assets/ has no AssetId until the database has seen it and written a .meta beside it; the compile that turns it into a chunk happens afterwards and on its own schedule. So the bake writes, scans, and reads back the GUID — and the entity is pointed at an asset that exists whether or not the content build has caught up, which is what MeshExtractionSystem's "ask again next frame" is already written for.
⚠ An existing file of the same name is overwritten, and it keeps its GUID. Baking the same wall twice is a designer iterating, and a second asset each time would leave the project full of Wall_3 — where overwriting means every entity already pointing at that asset picks up the new shape, which is what somebody re-baking a shared piece means.
Fields and properties (2)
public string FolderWhere baked meshes go, relative to the project's assets.
public string? WrittenThe last file this wrote, as a full path, or null if it has written none.
Methods (2)
public ProjectMeshBaker(EditorProject project, string folder = "Blockout")Puts a baked block-out mesh into the project and says what asset it became.
public AssetReference Bake(string name, string extension, string content)Writes a mesh into the project and imports it.
Used by (1)
- EditorApplicationVixen.Editor.App