@threepipe/plugin-blend-importer
v0.3.1
Published
Basic importer for .blend file
Maintainers
Readme
@threepipe/plugin-blend-importer
Integration and plugin for threepipe to import and render Blender(BLEND) files (fork of js.blend)
Compressed .blend files are loaded automatically: gzip (legacy Blender) decoded via the bundled fflate, and zstd (Blender 3.0+ default save format) decoded via fzstd.
Accessing the parsed file
Pass onBlendLoad to viewer.load(...) to receive the raw parsed Blender file alongside the Scene. Useful for the embedded preview thumbnail, the raw DNA tree, library/kinematics references — anything that isn't represented in the three.js Scene.
import {BlendLoadPlugin, BlendFile} from '@threepipe/plugin-blend-importer'
viewer.addPluginSync(BlendLoadPlugin)
await viewer.load('path/to/file.blend', {
onBlendLoad: (blend: BlendFile) => {
if (blend.thumbnail) {
console.log(`embedded thumb: ${blend.thumbnail.width}×${blend.thumbnail.height}`)
// blend.thumbnail.data is a Uint32Array (RGBA8 packed per pixel)
}
// blend.objects.Mesh, blend.objects.Material, etc. — raw DNA structs
},
})Don't write blend data onto userData — it gets serialized by export pipelines and large typed arrays (the thumbnail is ~64 KB) will balloon outputs or fail JSON encoding.
Github — Examples — API Reference
Documentation and Guides: threepipe.org/package/plugin-blend-importer
