Content
Model loading
181 symbols, imported from @driftengine/assets.
Explained in Importing models.
Classes
Animation- Everything that animates a datablock: its active action, then its NLA tracks bottom to top.
BlendData- A parsed file: its blocks, its catalogue, and the maps from an address to a block.
BlendNeedsBlender- Thrown when a
.blendholds something only Blender can evaluate, with each thing named. BlendStruct- One struct in the file, read by field name.
DrftLoader- A
.drftloaded progressively: the model builds up on screen instead of appearing. TextureSet
Interfaces
AssetReference- A texture a model named, with its bytes when the model carried them inline.
BlendBlock- One block: a run of
countstructs of catalogue typesdna, atoffsetin the file. BlendColorLayerBlendGltfBlendHeader- What the first bytes say, before any block is read.
BlendMeshDataBlendPlaced- One drawn object, or an empty that carries others, at its place in the world.
BlendPrimitiveBlendSurface- A material's surface, channel by channel. Factors multiply the map where there is one.
ChannelInputChannelSource- A channel of an image, as a socket reads it.
ClusterDagClusterLevelClusterOptionsClusterSetCoarseLevelOptionsCurve- One keyframed property of one animated datablock.
DdsImage- What a decoded surface is: level 0, RGBA, eight bits a channel.
DnaField- One field of a catalogued struct, with its offset already summed.
DnaStructDrawGrouping- The fields a merged group carries, resolved from a material and its override.
DrawSurfaceOverride- The override
DrftLoaderOptions.surfacemay return for a material. DrftFieldPlacement- One field, where it stands.
DrftLoaderOptionsDrftLoadProgress- How far a load has got, and every field here now answers about the picture rather than about the work.
DrftPartDtexTiles- Where each tile's bytes sit in the latent payload, and what they hash to.
EncodedMaterialEncodeMaterialOptionsGltfAnimatedGltfDocumentGltfSkin- Skins and animations out of a glTF document, sorted into the order a palette can be resolved in.
IesProfile- A fixture's measured intensity, as a grid over vertical and horizontal angles.
ImageInfo- What an image is, from its own first bytes. One responsibility: identify, never decode.
ImpostorKtx2Texture- A KTX2 file's blocks, and the colour space its format names.
LoadedRegionLoadedRegionLevelLocalisedModelImport- What a reader found, before anything is oriented, welded or written.
ModelSource- A model file, plus the capabilities its format may need to be read.
ModifierVerdict- What an object's modifier stack means for the direct reader.
ObjectSdf- What an object's distance field is, and why it is baked rather than computed.
ProxyCell- A cell's geometry, keyed by the identifier
core/src/world/cell.tsgives it. RadianceImage- An equirectangular image, linear, three floats a texel, row 0 at the top.
Recognised- What a file turned out to be, and what a person should do with it.
RepeatsSimplifyOptionsSlotNeeds- What a material slot asks of the geometry that wears it.
StlAppearance- What a caller may supply, since the format carries none of it.
ThreeMfResult- What a
.3mfyields, in the shape every other reader in this directory returns. UsdResult- What a
.usdayields, in the shape every other reader in this directory returns. ViewFrame- The sphere a bake frames its views on: a centre and a radius, and nothing about direction.
ZipEntry- One file in the archive.
bytesis decompressed and ready to read.
Functions
actionCurves- The F-curves an action holds for
slot: its channel bag in a layered action, every curve otherwise. activeScene- The scene the file was saved looking at.
assetCandidates- Paths to try for a reference, best first, relative to the folder holding the model.
bakeObjectSdf- Bake one mesh into a signed distance field.
bakeSceneField- The field of every mesh
includeadmits, merged, atvoxelMspacing, as the file's whole-geometry entry. Null when nothing is admitted. basenameOf- Everything after the last separator.
blackbody- The colour of a black body at
kelvin, in linear Rec. 709, scaled to unit luminance: what Blender multiplies a light's colour by when the light takes its colour from a temperature. blendCompression- The compression a
.blendwas saved with, by its magic, or null for a plain file. blendToGltf- Build the document.
buildClusterDagbuildClustersbuildCoarseLevel- Build the coarse level, or
nullwhen there is nothing to build one from. buildImpostor- Bake
directions²views of a mesh into one atlas. buildProxy- One mesh standing in for a whole cell group, or
nullwhen it is not worth having. cappedSize- The size
widthbyheightis halved to until its longer side is at mostmaxSide. colliderBeside- The collision hull a vehicle folder ships beside its model, or null.
componentCount- How many connected pieces the indices make of the mesh. Unreferenced vertices count as their own.
convertHandedness- Mirror an asset into the engine's right-handed frame, in place.
cornerNormals- The normal every corner is shaded with, three floats per corner, in the mesh's own space.
customProperties- An ID's custom properties that are plain values, for glTF's
extras. ddsBlocks- The surface's blocks and stored levels, as views over
bytes. ddsToRgba- Decode a DDS surface's level 0 into RGBA.
decodeBc- A whole surface of blocks into RGBA, eight bits a channel,
widthbyheight. A surface that is not a whole number of blocks is decoded block by block and cropped, which is what the format does: the blocks cover a padded rectangle and the texels past the declared size are padding. decodeBcImageblocksas an RGBA image, eight bits a channel, every channel meaning what an image's does.deriveTangentsFor- Derive a tangent frame for a mesh that has none, after it has been welded.
describeImage- Identify an image and read its dimensions, or refuse by name.
describeRecognised- The refusal, as one block of text a person can act on.
describeUpAxis- What the turn does, in words, for the line the baker prints.
downscaleRgba- A box average from
width×heightdown tooutWidth×outHeight, four bytes a texel. drawKeyOf- The key two parts must share to be merged into one draw.
dropDefaultAttributesdtexFromEncodedencodedas aDtexMaterial, withchannelssaying what each of its outputs is.dtexTileBytes- The bytes of one tile, by where it is rather than by its number.
encodeEtc2rgbaatwidthbyheightasformatblocks, row of blocks after row of blocks.encodeEtc2Chainrgbaatwidthbyheight, and each level below it to 1x1, asformatblocks.encodeMaterialextensionOf- The extension of a file name, lower case, including the dot. Empty when it has none.
faceNormals- Each face's normal, by the rule Blender uses for its size: two edges of a triangle, the two diagonals of a quad, and Newell's method beyond that.
fbxToMeshes- Geometry out of a parsed tree, one
MeshDataperGeometryrecord. findEntry- The first entry whose name matches, or null. Case-insensitive, since archives disagree.
findRepeats- The prototype and placements for the largest candidate count that
meshis exactly that many rigid copies of, or null when none is. flipBc5Green- A copy of
blocks, a level of BC5, with every block's green half turned over. frameOf- The frame that fits every mesh given. A radius of zero for a point, rather than a NaN.
gltfToMeshes- Turn a document into meshes in world space, one per primitive.
imageMime- A packed image's media type, from its first bytes.
imagePath- Where an unpacked image lives, relative to the
.blendwhen Blender wrote it that way. isBlend- Whether these bytes are an uncompressed
.blend. isDds- Whether these bytes are a DDS at all. The magic, and nothing inferred from a file name.
isOutlineWorthWriting- Whether a built level is worth writing into a file as an outline.
judgeModifiers- Judge an object's modifier stack.
latentImageOf- The latent as the interpreter takes it: normalised floats,
componentswide, with its chain. levelsBeside- The separate levels of detail a bundle ships beside its model, finest first.
localiseNodes- Move each mesh into the frame of the node that placed it, and report every node's world matrix.
localMatrix- The object's transform relative to its parent: location, rotation and scale, deltas folded in.
materialSlots- An object's material slots: the object's own material where its slot says so, else the mesh's.
meshPrimitives- Split a mesh into one primitive per material slot it uses.
mirrorNodes- Mirror an asset's hierarchy by the same reflection
convertHandednessmirrors its geometry by. octahedralCoord- The octahedral coordinate a direction came from: the inverse of
octahedralDirection. octahedralDirection- The direction a tile of the atlas was baked from, for an octahedral coordinate in
[0, 1]. openBlend- Open a
.blend's bytes, decompressing them first where the file was saved compressed. orientLights- Authored lights, turned into the engine's frame by the turn
orientMeshesgives the geometry. orientMeshes- Stand an asset up, given which of its axes points at the sky.
orientNodes- Turn an asset's hierarchy by the same rotation
orientMeshesturns its geometry by. orientTransforms- Column-major 4×4 placements, turned into the engine's frame:
O · M · Oᵀfor each, withOthe same turnorientMeshesgives the geometry. A copy the file moved along its own +z is then moved along the engine's +y, and a placement that was a rotation stays one of the same angle. packedImage- The bytes a packed image holds, or null where it lives in a file beside the
.blend. parseMtl- Parse a
.mtl. parseObj- Parse an OBJ.
materialsis the parsed.mtl, if the caller resolved one. parseStlparseThreeMfModel- Read the
3dmodel.modelXML out of a 3MF archive. parseUpAxis- Read an axis a person typed.
zand+zmean the same thing; anything else is refused. parseUsda- Read a
.usdadocument. placeObjects- Walk the scene into placed objects, naming in
refusalsanything that needs Blender to run. prepareFbxInflateprepareZipInflate- The same trick for a zip, which is how a
.3mfand a bought archive both arrive. proxyResolution- The grid a level uses. Each level halves the last, which is what makes it a hierarchy.
rasteriseView- An orthographic rasterisation of a mesh from one direction, as
resolution²RGBA texels. readBlend- A
.blendas a glTF document, refusing it whole when any part of it needs evaluating. readBlendMesh- Read a mesh datablock into plain arrays.
readBlendSurface- Read one material's surface.
readCurve- One F-curve, ready to evaluate.
readerFor- Whether this project has a reader for an extension. Lower case or not.
readGlb- Split a
.glbinto its JSON and its binary chunk. readGltfSkinsreadIesProfile- Read an LM-63 photometric file.
readKtx2bytesas a KTX2 file of one 2D block texture. Throws, naming the reason, on anything else.readModel- Read one model file into meshes.
readRadianceHdr- Read a Radiance RGBE file into linear radiance.
readZip- Every file in an archive, decompressed.
recognise- What this file actually is, when it is something with no reader here.
resolveDrawGrouping- Resolve what a part will actually be drawn with.
sampleImpostor- Sample the impostor as the shader would: bilinear inside a tile, bilinear across the four tiles around the requested direction.
simplifyMeshtextureColorSpaces- How each of an asset's images should be sampled, decided from what its materials call them.
threeMfToMeshes- Read a
.3mfarchive. tileGridFromDtex- The grid a chunk's table describes, or
nullwhere the material is one image and not streamed. triangulateFace- Triangles of one face, as corner indices, appended to
out. unpackBlend- The plain bytes of a
.blend, decompressing first where the file says it is compressed. usdzToMeshes- Read a
.usdz: a zip holding a.usdaor a.usdc, plus whatever images it names. weldMesh- Weld one mesh. Returns the same mesh when nothing can be merged.
writePartMaterialpart's maps and factors intoout, resolving each map throughtextures.zstdFrames- Each frame's compressed and decompressed length, from the seek table, or null where there is none.
Types
AsyncInflate- Turn a deflate stream into bytes, eventually. What a browser can actually offer.
BlendDecompress- Decompress one gzip stream or one zstd frame. Supplied by the host.
DrftFit- How a loaded model is placed: fitted to a size, or left exactly where its file puts it.
DrftLoadPhase- Where a load has got to, in the order a file delivers it.
Etc2Format- The formats this encodes: colour, colour with alpha, and one or two channels of data.
Handedness- Which way round a format's coordinate system is.
Inflate- Turn a deflate stream into bytes. Supplied by the caller; see the note above.
UpAxis- Which way is up in the asset, as a signed axis of the engine's own frame.
Constants
browserInflateDecompressionStream, which every target browser has and which needs no dependency.browserInflateRaw- Raw deflate through the browser, which is what a zip needs and what FBX must not be given.
DEFAULT_COARSE_CELLS- The grid this uses when nobody names a resolution, exported because two other places used to carry their own copy of the number and disagreed with it.
IMPOSTOR_GUTTER- Texels of edge repeat around every tile.
IMPOSTOR_TILE- Texels a tile's picture occupies, before its gutter.
MODEL_FORMATS- Every extension this project reads, in the order a bundle should be picked from.
OB_ARMATUREOB_EMPTYOB_LAMPOB_MESHPROXY_BASE_CELLS- Grid cells along the longest axis of a level-0 proxy.
PROXY_MIN_CELLS- The finest a proxy is allowed to get, matching
buildCoarseLevel's own floor.