Model loading · interface
ModelSource
A model file, plus the capabilities its format may need to be read.
Explained in Importing models.
interface ModelSourceimport type { ModelSource } from '@driftengine/assets';Properties
| Name | Type | Description |
|---|---|---|
namereadonly | string | The file's own name, used for its extension and in messages.MoreThe extension is a claim and the magic bytes are the fact, which is why |
bytesreadonly | Uint8Array | |
besidereadonlyoptional | (relativePath: string) => Promise<Uint8Array | null> | Fetch a file named beside this one, or null where there is none.MoreNeeded by a |
inflatereadonlyoptional | Inflate | zlib-wrapped inflate, for .fbx. See fbxInflate.ts for the browser's. |
inflateRawreadonlyoptional | Inflate | Raw deflate inflate, for the zip inside a .3mf. Not the same function as inflate. |
decompressreadonlyoptional | BlendDecompress | gzip and zstd, for a .blend saved compressed. See blendPacked.ts. |
deriveTangentsreadonlyoptional | boolean | Derive a tangent frame where a material declares a normal map and the file supplies none.MoreOn by default. A caller that is about to weld should pass false and call
Only glTF derives one at all, so this is inert for every other format. A frame the file supplies is kept either way. |