BUI Extracts Blender's UI Into a Multi-Language Library
BUI decouples Blender's widget drawing, interaction rules and visual style into a standalone UI library callable from Python, Rust, JavaScript/React, C, C++ and Dear ImGui. It emphasizes low memory footprint and fast rendering, and claims to outperform GPUI, though no reproducible benchmark data backs that comparison yet.
Related Entities
Full Report
Contents4 sections
BUI
Blender's user interface, as a library you can use from Python, Rust, JavaScript/React, C, C++ and Dear ImGui.
People spent decades building and optimizing Blender's GUI. It's battery and memory efficient, and super duper fast. We decoupled it, to give everyone a chance to build their own products with it. It supports multiple languages and frameworks, so you won't miss a beat!
Website and full documentation: bui.preetham.top
<img src="/api/v1/file/hot_img_cf10eaa9baf3ab3487518b35ca5dec77.webp" width="330" alt="BUI's Blender components: panels, number sliders, vector fields, checkboxes and a color swatch"> <img src="/api/v1/file/hot_img_a61024621fe7de3a680be246ce1577c2.webp" width="300" alt="An unmodified tkinter program running on BUI"> </div>This README is a small book. Read it front to back for the whole story, or
jump to the chapter you need. Every chapter links to a longer guide in
docs/ or on the website when there's
more to say.
1. What BUI is
BUI takes the user interface of Blender (its widget drawing, its interaction rules and its look) and turns it into a standalone UI library with a small C core. Your code builds the widget tree and handles callbacks. Layout, input, drawing and presenting all happen in fast native code, on the CPU or the GPU.
At the heart of BUI is the kit: a small runtime written in C. The kit holds every widget in one tree, lays them out, handles the mouse and keyboard, and draws them the way Blender does. The drawing code is a C port of Blender's own widget code, and the interaction follows Blender's rules. On top of the kit sit bindings: thin layers that let Python, Rust, JavaScript, C++ and Dear ImGui talk to it.
What BUI is not:
- Not Blender. It contains the parts of Blender's UI code it needs and builds on its own. You don't need Blender installed, and you don't need to know Blender to use it.
- Not a browser. The Rust and JavaScript sides use HTML and CSS as a UI language, but there's no browser engine, no webview and no network.
- Not a re-imagining. The widget drawing is ported from Blender's
interface_widgets.cc, and the Dear ImGui support runs the real Dear ImGui.
2. Why BUI exists
Blender's interface is famous for how it feels. You press a number field and
drag: the cursor vanishes, the value glides under your hand, and you never hit
the edge of the screen. You type 2*pi into a field and it just works. You
type "ad cu" into a menu and it finds "Add Cube". Millions of artists have
these habits in their hands.
That interface is also fast and frugal. It redraws only what changed, sleeps when nothing does, and starts in milliseconds. BUI exists so that any app, in any language, can have both: Blender's feel, and Blender's efficiency.
3. Who it's for
- You have a tkinter app and wish it looked less like 1998. Run it on BUI, unchanged.
- You're building a tool for artists who already know Blender. Give them the panels, sliders and shortcuts their hands expect.
- You write Rust or React and want a native desktop UI without shipping a browser.
- You use Dear ImGui and want it to look and feel like Blender, with one build flag.
- You're curious how a UI toolkit works. The source is readable, and the concepts are explained in plain words.
4. The many ways in
You can drive BUI many ways, and all of them share the same C runtime, so they all get the same widgets and interactions:
| You write | You get | Status |
|---|---|---|
| tkinter code, even existing programs, unchanged | Blender-styled apps; every tkinter and ttk API | Complete |
Qt-style Python (QWidget, layouts, clicked.connect) | The common subset of Qt widgets | Partial |
Blender components (Panel, NumberSlider, PieMenu, the node editor ...) | 45 native Blender widgets and editors, from Python; ten of them also from Rust and JavaScript | Complete |
Rust: HTML + CSS + Tailwind, HTML-like markup (rsx! / view!), hooks, or gpui / zopra syntax | A web-like framework: HTML that looks like a browser's, Blender's look with styled, and Blender components (<NumberSlider>, <Button> ...) | Working |
| JavaScript / React on Node.js or Bun: a DOM-like API or JSX | The same engine and components in native windows, over napi-rs; React's hooks backed by signals | Working |
| Dear ImGui from C++, C, Python or Rust | The real Dear ImGui on BUI windows in Blender's theme, or a build where ImGui's widgets are Blender's widgets | Working |
C (BUI_kit.h) | The kit itself: nodes, widgets, windows |
(注:更多技术实现细节与完整 API 文档请查阅原项目 README)