Vixen
dd8b0a81
csharp
public sealed class MeshMapLibrary

Every baked mesh map a project holds, indexed the way § 4.8's Mesh Map Input asks for one.

Read the guide page for this →

Remarks

Doc 48 § 4.8's read side, and until this existed there was none. Nine files land in Assets/MeshMaps/ per mesh with a sidecar naming what each one measures, and #702 is the observation that UsageKey was written by ProjectMeshMapBaker and read by no file in the repository. A generator compound that works on every mesh is exactly a graph that asks for Curvature and is handed whichever file this project's bake produced — so the binding is a query, and this is the query.

⚠ Over the sidecar keys and not over the file names, which is the whole reason it is a type rather than a Path.Combine. MeshMapNaming's own remarks say which of the two wins: a file somebody renamed still knows what it measures, and doc 08's argument is that a path is a fact about today. A resolver built on FileName would silently stop finding a map the moment an artist tidied the folder, which is the failure this binding exists to avoid.

⚠ A snapshot, deliberately, and it is stale the moment a bake writes. Indexing opens one sidecar per candidate file, so a query that re-read the project would be a directory's worth of file reads per node per evaluation. A caller rebuilds it after a bake — which is the same contract AssetDatabase.Scan has with everything that reads its index.

⚠ An ambiguous query is refused rather than resolved by enumeration order. A model with three meshes has three sets and every one of them has a curvature map, so "the curvature map of this model" is not a question with an answer — and TextureRunner.Read makes the same call about two files claiming one usage, for the same reason: picking one silently is how a graph binds the wrong map on one machine and the right one on another.

Fields and properties (2)

  • public IReadOnlyList<MeshMapAsset> Maps

    Every mesh map found, in the order the database enumerated them.

  • public IReadOnlyList<string> Sets

    The names of the sets found, each once, ordered.

Methods (4)

  • public static MeshMapLibrary Index(AssetDatabase assets)

    Reads every baked mesh map a database has indexed.

  • public bool TryResolve(string set, MeshMapUsage usage, out MeshMapAsset map)

    The map one set measures a given thing with.

  • public bool TryResolve(AssetId model, MeshMapUsage usage, out MeshMapAsset map)

    The map a model's one set measures a given thing with.

  • public IReadOnlyList<string> SetsOf(AssetId model)

    The sets a model has baked, each once.

Used by (5)

  • MeshMapBakeGeometryTestsVixen.Editor.App.Tests
  • MeshMapBindingVixen.Editor.Assets
  • MeshMapGeneratorBindingTestsVixen.Editor.App.Tests
  • MeshMapLibraryTestsVixen.Editor.App.Tests
  • MeshMapRunnerVixen.Cli