Log inGet started
World

Builtin Library

Branchmain
Branchesmainpublish
Commit61a33237e0

README.md

previewRecipe (module)

How a type makes its instances' pictures. A type declares it in its type.yaml, under preview:, and every instance's preview.png is produced by the recipe named there.

preview:
  kind: surface        # instantiate | image | surface | custom
  mesh: sphere         # surface: the builtin mesh the asset is painted on
kindThe picture isNeeds
instantiatethe asset stood in the studio through its own instantiate—
imagea file the instance already holds, fitted to the framesource.file or source.files
surfacethe asset painted on a builtin meshmesh
customwhatever the type's behavior.luau ref.preview returns—

angle: [yaw, pitch] (degrees) states the bearing the camera looks from, for any kind that renders.

The preview: block says how the picture is PRODUCED. Whether search embeds that picture is a separate declaration — an image chunk under indexing.content naming preview.png — so a type states both, and a type that states one without the other gets exactly what it stated.

Exports

  • M.of(typeName) -> PreviewRecipe? — the recipe typeName declares, or nil when it declares none or no type answers to that name. Read once and held; a block naming an unknown kind, or missing what its kind needs, is refused with a warning naming the type.
  • M.forget() — drop every held recipe. The change dispatcher calls it, with declaration.forget(), for every write inside an .assetType folder and for every removed type, so an edited type.yaml is read again.