Model loading · interface

BakeModelHooks

What only the host can do. Each is optional, and each default is the one a host with no disk wants.

Explained in Importing models.

interface BakeModelHooks
import type { BakeModelHooks } from '@driftengine/assets';

Properties

NameTypeDescription
logreadonlyoptional(line: string) => voidA line worth printing; the command prints it.
warnreadonlyoptional(line: string) => voidA line that is a warning.
texturesreadonlyoptional(refs: readonly AssetReference[], materials: readonly DrftMaterial[] | undefined, warnings: string[]) => Promise<DrftTextureSource[]>The pictures the materials reach, embedded, in the order given. warnings is the bake's own list, so a picture that was not found is said with the rest. The default embeds what the model carried and stands a white texel in for what it only named.
levelsreadonlyoptional() => Promise<Uint8Array[]>Separate levels of detail the host found beside the model, each a whole .drft.
collidersreadonlyoptional(meshes: readonly MeshData[]) => Promise<Float32Array[] | undefined>Colliders the host was asked for, from the meshes as they will be written, or undefined where it was asked for none, in which case any a .drft export carried stand.