ThreeJS / Blender in browser - WebAssembly

I saw this repo pop up earlier this Summer from the HeyPuter dev, GitHub - HeyPuter/blender-wasm: :ice: Blender in the Browser · GitHub - I want to emphasize I didn’t do that portion of the work which is a multi-layered blender fork to support webgpu backend (and recently webgl) and series of curated toolchain steps in order to get this thing built. I did fork it and make an engine API out of it however - GitHub - knervous/blender-wasm: 🧊 Blender in the Browser · GitHub

I got the rough edges smoothed for integration in an embedded not-only-sandbox-via-iframe environment locally back then but was recently inspired by someone to continue making a more polished library.

I’m typically a babylonjs dev but just as much respect for the threejs community, it’s where I got started with 3d web dev years ago – so the wrapper for the Blender API includes adapters for threejs as well as BJS and BJS-Lite (wgpu only)

Not sure the most useful way y’all share code snippets, but I threw one up on stackblitz to demo this in the browser:

rich text editor imagerich text editor image

I am going to draw the line for myself at exposing the engine API through this npm package and just the minimal prototype for an editor in the UI - will leave it up to the community to integrate into existing editors. Am going to do my best to try to start the conversation upstream to the original dev, velzie, and see if it fits their original repo’s intent.

Here is the npm package - it’s in flux right now version wise, can’t guarantee an ETA on “stable” but it should work at it’s current version given the set of features it describes.

Blender is a beast, by default it has a host of dependencies that assume multithreaded capabilities. There are two published versions (threads and single threaded) and the module’s entrypoint detects which is available and uses that based on where it’s hosted (need SharedArrayBuffer for threads)

https://www.npmjs.com/package/@knervous/blender-web