mcp-for-blender
Community plugin to control Blender 3D with any LLM of your choice. Not affiliated with the official Blender Foundation.
- 35k
- Python
- MIT
- 5 d ago
Blender's GPU Accelerated UI, Decoupled from it's original codebase. Supports Rust, Python, JS, Lua, C & C++. Twice as good as GPUI
Repo ppmpreetham/BUI, read from GitHub 1 min ago. ppmpreetham has not joined Take My Repo.
ppmpreetham/BUI is a public repo on GitHub by ppmpreetham. Blender's GPU Accelerated UI, Decoupled from it's original codebase. Supports Rust, Python, JS, Lua, C & C++. Twice as good as GPUI. It declares the GPL-3.0 license on GitHub. It is written mainly in C++, has 2,657 stars and last changed on 2026-11-23. Nobody has reviewed it on Take My Repo yet, which says nothing about its quality. Read from GitHub on 2026-11-23.
In the maintainer's words. Shown from GitHub; Take My Repo does not keep a copy.
Blender's user interface, as a library you can use from Python, Rust, JavaScript (React, Svelte, Vue), C, C++, D 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 · Chat: Discord
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.
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:
interface_widgets.cc, and the Dear ImGui support runs the real Dear ImGui.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.
Before you ship something with BUI, read the known limitations: no accessibility support yet, no input methods, and it looks like Blender, not like your operating system.
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 / Svelte / Vue on Node.js or Bun: a DOM-like API, JSX, Svelte or Vue components | The same engine and components in native windows, over napi-rs; React's hooks backed by signals; Svelte 5 and Vue 3 components | 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 | Working |
D (the bui DUB package in bindings/d) |
Idiomatic D wrappers, the complete raw C API and an HTML/CSS/RSX authoring layer | Working |
Go: the kit's nodes (bindings/go/bui), or MyGo-style views (ui.Column(c).Children(...), ui.Checkbox(c, &v, "Sync")) |
Blender's widgets from Go, with a headless Tester for go test |
Working |
Ruby (the blenderui gem in bindings/ruby) |
A C extension over the kit (no FFI): nodes, windows and menus, interfaces built from blocks, headless tests | Working |
Not sure which to pick? If you already have code, use the row that matches it. If you're starting fresh in Python, the Blender components are the friendliest.
2*pi, min(4, 3), round(1.7), x if c else y.QPainter, menus and timers.from blenderui import imgui, pyimgui-style.pip install, no Qt or Tk widgets drawing anything.styled gives any subtree Blender's look, and Blender components (<NumberSlider>, <Button>, <ColorSwatch> ...) are real Blender widgets.calc() and every math function, var(), oklch() and color-mix(), :has(), nesting, @layer, @media ranges, @container, ::before/::after, counters.@keyframes animations and transitions, filters, backdrop-filter, blend modes, clip-path, masks, 2D transforms, border-image.class="md:hover:bg-sky-500/50" or bare attributes (<div p-4 bg-[#4772b3]>), with "did you mean" compile errors.rsx! / view! HTML-like markup, #[component], and hooks in zopra, React or Leptos style (use_state, signal, Memo, Effect, context).div().flex().gap_2(), Render, cx.listener.window_control_area(WindowControlArea::Drag) or CSS app-region: drag; on Windows it keeps resize edges, Aero Snap and snap layouts.cargo add blenderui.<motion.div initial animate exit whileHover whileTap whileInView drag layout> in Rust's rsx!, gsap.to / from / fromTo / timeline and motion.animate in Rust, JavaScript, Python and Lua, and Motion's props in React. One C engine in the kit runs them all, so no language carries its own.cubic-bezier(), steps(), linear() and SVG paths.static read once per call site in Rust, and an idle window costs no CPU. It is not allocation-free yet: calls build their values once, and a callback or onUpdate costs an event per call (the Rust side is being tightened). What a frame costs.anim, on by default). Docs: Rust, JavaScript, Python.BK_ITEM_EFFECT, Rust Painter::effect), run on Direct3D 11 and OpenGL in paint order with an image as the fallback; the compile log comes back as a string.platform/android, docs/android.md): the kit's window host on a NativeActivity, so C, Lua and Rust apps run as on a desktop (Application::run, bui.open); damage-driven rendering, touch scrolling and the soft keyboard; python platform/android/build.py [--lua DIR | --rust CRATE] makes a signed APK of 1 to 2 MB. Run on an emulator; the arm64 builds were not run.RenderTarget, BUI_target_create, Painter::effect_to, Rgba8 / Rgba16F / Rgba32F) and sample it in a later pass, so simulations can feed back on themselves. Tested on Direct3D 11; the OpenGL backend has the same code and has not been run.frame holds one frame; reduced motion holds them all.<video> in every language, decoded by the OS (Media Foundation with DXVA, GStreamer, AVFoundation; loaded at run time) at the size drawn, frames in one GPU texture per player updated in place, YCbCr converted in the shader, and nothing decoded off screen. 1080p plays at 0.99 ms render frames and 9 % of a core on the GPU renderer, five at once at 28 %, with 0 allocations per frame. Play, pause, seek, rate, loop, poster, state events, and Blender-style controls. Video.<img>, CSS background-image, object-fit, Blender Image components, tkinter PhotoImage (now also JPEG, WebP, BMP, TGA, QOI, HDR, SVG), canvas items, data-table image columns, chat-list media and Dear ImGui textures (animated ones too).<NumberSlider>, <Button> ...). BUI draws them, on the CPU or the GPU; there's no browser and no webview.{count}) and a change updates that one node without re-rendering; read it while rendering (count.value) and the component re-renders, as with React. A conformance suite checks each hook against React's own.@blender-ui/svelte): components with runes, snippets, bindings and scoped styles, mounted into native windows; Svelte's compiled code runs on BUI's DOM, so a $state change updates the one node that shows it.@blender-ui/vue): single-file components with refs, v-model, slots and scoped styles, mounted into native windows through Vue's own createRenderer; Vue's compiler compiles your .vue files.@blender-ui/native: a DOM-like API (createElement, appendChild, addEventListener) with the same signals, for apps without a framework, and the shared layer the React, Svelte and Vue bindings are thin adapters over.bui build app.jsx produces one executable of 6.3 to 6.9 MB (by the features it uses): BUI with an embedded QuickJS engine.--bun builds a Bun executable instead, with Node's APIs and a JIT.features.json) drives CMake options, cargo features and bui build, which links the smallest runtime an app needs: 6.3 MB for hello world, 6.9 MB with images or video. Binary size.imgui.h works, including ShowDemoWindow().imgui.h), C (cimgui.h, all 399 functions), Python and Rust (generated from imgui.h).BUI_IMGUI_BLENDER_WIDGETS=ON, Blender's actual widgets and interaction, pixel-identical to BUI's own.Xft.dpi on Linux, Retina on macOS.Every screenshot here is a real BUI window, rendered off-screen. Where an image comes in a dark and a light version, GitHub shows the one that matches your theme.
The node editor, from Python (examples/site/geometry_nodes.py)
A pie menu, and Blender's menu search (type in any open menu)
The color picker, and a tooltip
CSS effects in Rust: filters, clip-path, transforms, blend modes, backdrop-filter (site_effects.rs)
CSS grid with repeat(auto-fill, minmax()), spans and grid-auto-flow: dense (site_grid.rs)
CSS @keyframes at 0.25 s, 0.6 s and 1.0 s (site_animation.rs)
examples/showcase.rs: HTML + CSS in Rust
Dear ImGui's demo with its own widgets, in Blender's theme
Qt syntax
tkinter programs: text with tags, canvas, dialogs
The bui command (any language). One line installs it, and bui new makes a project in
Rust, JavaScript or TypeScript (React, Svelte or plain DOM), Python, Lua or C, with that
language's lints, checking its tools first and installing the newest BUI with its own package
manager:
curl -LsSf https://bui.preetham.top/install.sh | sh # Linux and macOS
irm https://bui.preetham.top/install.ps1 | iex # Windows (PowerShell)
bui new my-app # asks what to write it in, then makes it
cd my-app
bui dev # run it
bui doctor # find what is wrong with the setup, and fix it
bui update # update bui and the project's BUI packages
Or install by hand, per language:
Python. You need CPython 3.11 or newer. Wheels are published for Windows, Linux and macOS, so there's nothing to compile. One package gives you all four Python APIs (tkinter syntax, Qt syntax, the Blender components and Dear ImGui):
pip install blenderui
python -c "import blenderui; print(blenderui.__version__)"
Import it as blenderui. You'll also see import bui in older examples: it's
the same code under its original name, but an unrelated project owns bui on
PyPI, so prefer blenderui in anything you publish.
Rust. The crate is blenderui on crates.io:
cargo add blenderui
The first build compiles BUI's C kit for you, so you need Rust 1.88 or newer,
CMake and a C compiler (on Windows, the Visual Studio Build Tools for the
default MSVC target), and on Linux the X11 headers (libx11-dev or
libX11-devel; no GL headers are needed).
JavaScript. You need Node.js 18 or newer, or Bun:
npm install @blender-ui/react react # or: bun add @blender-ui/react react
npm install @blender-ui/svelte svelte # Svelte 5
npm install @blender-ui/vue vue # Vue 3
npm install @blender-ui/native # the DOM-like API, without React
The npm packages are prebuilt for Windows x64, Linux x64 (glibc 2.35
or later; native X11 windows) and macOS. Elsewhere, build the addon from a
clone (npm install then npm run build in bindings/, with Rust, CMake and
a C compiler). On macOS, JavaScript runs headless for now (see
Platforms).
C and C++. Build from source with CMake 3.20+ and a C11 / C++20 compiler (MSVC, GCC or MinGW-w64, or Clang); on Linux, also the X11 headers:
git clone https://github.com/ppmpreetham/BUI && cd BUI
cmake -S . -B build
cmake --build build -j 2
ctest --test-dir build # optional: run the test suites
In your own CMake project, add BUI as a subdirectory and link bui::kit (or
bui::imgui for Dear ImGui):
add_subdirectory(BUI)
target_link_libraries(myapp PRIVATE bui::kit)
Dear ImGui. Python gets it with pip install blenderui
(import blenderui.imgui). C++ links bui::imgui, C links bui_cimgui.
Rust uses the blenderui-imgui crate:
cargo add blenderui-imgui
If something goes wrong:
| Symptom | Fix |
|---|---|
ImportError: buipy |
You're running from a source checkout without a build. Build first (cmake --build build), or set BUIPY_BUILD_DIR. The extension must match your Python version. |
| The window never appears | Start the event loop: mainloop(), app.exec() or App.run(). |
| Blurry or tiny UI | Set BUI_UI_SCALE, for example BUI_UI_SCALE=1.25. |
gpu=True does nothing |
Run with BUI_GPU_DEBUG=1 to see why the GPU device didn't start. Without Direct3D 11 or OpenGL 3.3, BUI stays on the CPU renderer, which draws the same pixels. |
More: docs/getting-started.md and Install BUI on the website.
Run any tkinter program on BUI without changing a line:
blenderui-tk my_app.py # same as: python -m bui.tksyntax my_app.py
blenderui-tk makes import tkinter return BUI's implementation for that
run. Or opt in from code:
import blenderui.tksyntax as tk
from blenderui.tksyntax import ttk, messagebox
root = tk.Tk()
name = tk.StringVar(value="Cube")
ttk.Entry(root, textvariable=name).pack(fill="x", padx=8, pady=8)
ttk.Button(root, text="Greet",
command=lambda: messagebox.showinfo("Hi", "Hello " + name.get())).pack()
root.mainloop()
That snippet is only a window with an entry and a button. These two are larger, unchanged programs from examples/site/, running on BUI:
Unchanged tkinter and ttk programs (examples/site/tk_export.py, ttk_queue.py)
Number fields (Spinbox, Scale) scrub like Blender's, Ctrl+Z / Ctrl+Shift+Z
undo edits, and filedialog opens Blender's File Browser. Guide:
docs/tkinter.md.
Build with Blender's own components:
from blenderui.components import App, Panel, NumberSlider, VectorField, Checkbox, ColorSwatch, Button
App("Object", (420, 520),
Panel("Transform",
VectorField("Location", (0.0, 1.25, 0.0)),
NumberSlider("Scale", 1.0, min=0, max=10, on_change=print)),
Panel("Shading",
Checkbox("Shadows", True),
ColorSwatch("Color", (0.8, 0.3, 0.1, 1.0))),
Button("Apply", on_click=lambda: print("apply")),
).run()
That snippet is a small window. This is a bigger program built from the same components, a Render Properties editor:
A Render Properties editor from the components (examples/site/render_props.py)
There are 45 components: layout, values, buttons, views, menus and pie menus, the color picker, the color ramp, curve and node editors, areas and templates. Reference: docs/components.md.
Write Qt-style Python. The import is the only line that differs from PySide or PyQt, and neither is needed:
import sys
from blenderui.qtsyntax import (QApplication, QWidget, QVBoxLayout, QFormLayout,
QLineEdit, QComboBox, QSlider, QProgressBar,
QPushButton, QLabel, Qt)
app = QApplication(sys.argv)
window = QWidget()
window.setWindowTitle("Export")
layout = QVBoxLayout(window)
form = QFormLayout()
kind = QComboBox()
kind.addItems(["glTF", "FBX", "OBJ"])
quality = QSlider(Qt.Horizontal)
quality.setRange(0, 100)
form.addRow("Format:", kind)
form.addRow("Quality:", quality)
layout.addLayout(form)
bar = QProgressBar()
quality.valueChanged.connect(bar.setValue)
layout.addWidget(bar)
status = QLabel("Ready.")
go = QPushButton("Export")
go.clicked.connect(lambda: status.setText("Exporting as " + kind.currentText()))
layout.addWidget(status)
layout.addWidget(go)
window.show()
sys.exit(app.exec())
A bigger program in the same syntax, a material editor (not the output of the snippet above):
Qt syntax (examples/site/qt_material.py)
Qt syntax is partial: 57% of Qt's public methods, signals and slots on
the 36 core widget classes, measured from Qt's headers by
tools/qt_coverage.py (per class). It has containers
(docks, toolbars, splitters, Blender-panel tool boxes), actions shared by
menus, tool buttons and shortcuts, Qt's full layout API, model/view on
Blender's tree list, validators, date and time editors and a calendar, real
QDialogButtonBox / QMessageBox / QInputDialog, QSettings and shortcuts.
Missing names raise AttributeError; a few setters are accepted and ignored
(listed in the guide). Guide: docs/qt.md.
BUI's Rust crate has two first-class syntaxes, and they draw the same window:
rsx! is HTML-like markup inside a macro, with #[component] functions
and hooks for state.div().flex().gap_3().child(...).
State lives in your view struct, and cx.listener updates it. gpui code
compiles against BUI too.In rsx! (this is
bindings/rust/blenderui/examples/hello.rs;
run it with cargo run --release --example hello in bindings/rust):
use blenderui::prelude::*;
#[component]
fn counter(label: &str) {
let (count, set_count) = use_state(0);
rsx! {
<div flex items-center gap-3 p-4 rounded-xl bg-zinc-800>
<span text-zinc-300>{label.to_string()} ": " {count().to_string()}</span>
<div px-3 py-1 rounded-md bg-sky-700 hover:bg-sky-500 onClick={move || set_count(count() + 1)}>
"Add one"
</div>
</div>
}
}
struct Hello;
impl Render for Hello {
fn render(&mut self, _: &mut Window, _: &mut Context<Self>) -> impl IntoElement {
rsx! {
<body m-0 p-6 min-h-screen flex flex-col gap-4 bg-zinc-900 text-white>
<h1 text-2xl font-bold>"Hello, BUI"</h1>
<counter label="Clicks" />
<NumberSlider min={0.0} max={10.0} value="5" /> // a real Blender slider
</body>
}
}
}
fn main() {
Application::new().run(|cx| {
cx.open_window(WindowOptions::default(), |_, cx| cx.new(|_| Hello)).unwrap();
});
}
In gpui builders, the same window:
use blenderui::prelude::*;
struct Hello { count: i32 }
impl Render for Hello {
fn render(&mut self, _: &mut Window, cx: &mut Context<Self>) -> impl IntoElement {
let counter = div().flex().items_center().gap_3().p_4().rounded_xl().bg(rgb(0x27272a))
.child(span().text_color(rgb(0xd4d4d8)).child(format!("Clicks: {}", self.count)))
.child(div().px_3().py_1().rounded_md().bg(rgb(0x0369a1))
.hover(|s| s.bg(rgb(0x0ea5e9))).cursor_pointer()
.child("Add one")
.on_click(cx.listener(|this, _, _, cx| {
this.count += 1;
cx.notify();
})));
body().m_0().p_6().css("min-height", "100vh").flex().flex_col().gap_4()
.bg(rgb(0x18181b)).text_color(white())
.child(h1().text_2xl().font_bold().child("Hello, BUI"))
.child(counter)
.child(NumberSlider().min(0.0).max(10.0).value("5")) // a real Blender slider
}
}
fn main() {
Application::new().run(|cx| {
cx.open_window(WindowOptions::default(), |_, cx| cx.new(|_| Hello { count: 0 })).unwrap();
});
}
Two small things that trip people up in rsx!:
&'static str, String, SharedString) or
elements. Numbers and borrowed &str props aren't, so write
{count().to_string()} and {label.to_string()}.rsx!.Here's a bigger example, a render-farm dashboard, written once in each syntax. The two programs draw identical pixels:
site_dashboard.rs (rsx!) and site_dashboard_builder.rs (gpui builders)
Guide: docs/rust.md, and the
Rust tutorial on the
website. A blenderui app also runs in a browser <canvas>, compiled to WebAssembly
(docs/wasm.md: python platform/wasm/build.py examples/wasm/counter --serve).
/** @jsxImportSource @blender-ui/react */
import { render, useState, NumberSlider } from "@blender-ui/react"
function Counter() {
const [count, setCount] = useState(0) // React's hook, holding a signal
return (
<main styled className="p-6 flex flex-col gap-3">
{" "}
{/* `styled`: Blender's look */}
<span>Clicks: {count}</span>
<button onClick={() => setCount((c) => c + 1)}>Add one</button>
<NumberSlider min={0} max={10} /> {/* a Blender component */}
</main>
)
}
render(<Counter />, { title: "Counter", width: 360, height: 200, gpu: true })
bun app.jsx # run it (Bun reads JSX directly)
npx bui build app.jsx # or ship it: app.exe, one 7 MB file
Without React, @blender-ui/native gives you a DOM-like API:
const { App, signal } = require("@blender-ui/native")
const app = new App({ gpu: true })
const win = app.window({ title: "Hello", width: 360, height: 200 })
win.body.className = "m-0 p-6 flex flex-col gap-3 bg-[#2b2b2b] text-[#e6e6e6]"
const clicks = signal(0)
const label = win.createElement("span")
label.textContent = clicks // follows the signal
const button = win.createElement("button")
button.textContent = "Add one"
button.addEventListener("click", () => clicks.value++)
win.body.appendChild(label)
win.body.appendChild(button)
These snippets are small. This is a larger example, a task list in React, and not the output of the code above:
A task list in React (examples/site/js/todo_react.js); the DOM-like version draws the same
The same task list in Vue 3 (examples/site/js/TodoVue.vue, state in refs, v-model on the Blender widgets):
A task list in Vue (examples/site/js/TodoVue.vue)
Node.js 18+ or Bun. Prebuilt for Windows x64, Linux x64 (glibc 2.35 or later)
and macOS; elsewhere, build the addon from source (npm run build in
bindings/node). Guide:
docs/javascript.md.
The real Dear ImGui 1.93 runs on BUI: BUI's windows, input, CPU/GPU renderer, Blender's theme and the Inter font. Existing ImGui code compiles unchanged.
C++:
#include "imgui.h"
#include "imgui_impl_bui.h" // see examples/imgui_demo.cpp
static void frame(void*) {
ImGui::ShowDemoWindow();
ImGui::Begin("Hello");
static float v = 0.5f;
ImGui::SliderFloat("Value", &v, 0.0f, 1.0f);
ImGui::End();
}
int main() {
ImGui::CreateContext();
ImGui_ImplBUI_App* app = ImGui_ImplBUI_CreateApp("Demo", 1280, 800, frame, nullptr);
ImGui_ImplBUI_RunApp(app);
ImGui_ImplBUI_DestroyApp(app);
ImGui::DestroyContext();
}
Python:
import blenderui.imgui as imgui # C: cimgui.h · Rust: the blenderui-imgui crate
state = {"value": 0.5}
def frame():
imgui.show_demo_window()
imgui.begin("Hello")
_, state["value"] = imgui.slider_float("Value", state["value"], 0.0, 1.0)
imgui.end()
imgui.run(frame, title="Hello", size=(1280, 800))
C (cimgui.h, cimgui conventions: ImGui_Button, ImGui_ButtonEx, and
the backend in cimgui_impl_bui.h) and Rust (blenderui-imgui) work the
same way:
use blenderui_imgui as imgui;
fn main() {
let mut value = 0.5f32;
imgui::run("Hello", [1280, 800], move || {
imgui::show_demo_window();
imgui::begin("Hello");
imgui::slider_float("Value", &mut value, 0.0, 1.0);
imgui::end();
});
}
Build with -DBUI_IMGUI_BLENDER_WIDGETS=ON (or the Rust feature
blender-widgets) and ImGui's widgets become Blender's own: DragFloat is
Blender's drag-to-scrub number field (Shift for precision, Ctrl to snap),
SliderFloat Blender's number slider, checkboxes drag-toggle, menus and combos
get Blender's menus. The rest of the ImGui API is unchanged. (The PyPI wheel
is built without it, so from Python you get ImGui's own widgets in Blender's
theme unless you build from source.)
Dear ImGui's own demo with BUI_IMGUI_BLENDER_WIDGETS=ON: number fields, sliders, color rows and panel headers are Blender's
A larger example, a scene inspector, once with ImGui's stock widgets and once with Blender's:
The same ImGui code: ImGui's widgets (left) and the Blender-widgets build (right) (examples/site/imgui_inspector.cpp)
Guide, coverage and the stock look: docs/imgui.md.
The kit's API is one header, kit/include/BUI_kit.h, and it doubles as the
reference: every function has a one-line comment. This is a shortened
examples/kit_hello.c: a slider and a button in a
native window.
#include <stdio.h>
#include "BUI_kit.h"
static void on_event(void *data, BKNode *node, int kind, void *ref, double a, double b)
{
if (kind == BK_EV_CLICK) printf("clicked %s\n", BK_get_str(node, "text"));
else if (kind == BK_EV_CHANGE) printf("%s = %g\n", BK_get_str(node, "label"), BK_get_num(node, "value"));
}
int main(void)
{
BKNode *root = BK_node_new("frame"); /* everything is a node */
BK_set_num(root, "padding", 8); /* configured by property name */
BKNode *size = BK_node_new("slider");
BK_set_str(size, "label", "Size");
BK_set_num(size, "max", 10);
BK_set_num(size, "value", 2.5);
BK_node_add(root, size, -1);
BK_geom_set_manager(size, BK_GEOM_PACK); /* Tk's packer, in C */
BK_geom_set(size, "fill", 1);
BKNode *apply = BK_node_new("button");
BK_set_str(apply, "text", "Apply");
BK_node_add(root, apply, -1);
BK_geom_set_manager(apply, BK_GEOM_PACK);
BKContext *ctx = BK_context_new(root); /* input, focus, popups, undo */
BKHost host = {0};
host.emit = on_event; /* the window fills in the rest */
BK_context_set_host(ctx, &host);
if (BK_window_supported()) { /* Win32, X11 or Cocoa */
BKWindow *win = BK_window_new(ctx, "BUI from C", 320, 120);
BK_window_show(win);
BK_window_run();
BK_window_free(win);
}
BK_context_free(ctx);
BK_node_free(root);
return 0;
}
cmake -S . -B build -DBUI_BUILD_EXAMPLES=ON
cmake --build build --target bui_kit_hello
The window below is a bigger program than the one above, a modifier stack:
A bigger C program: a modifier stack (examples/site/kit_modifiers.c)
Without a window system, render into a raster instead
(BK_render(ctx, raster, w, h, full)), which is also how tests and
screenshots work. Guide: docs/c-api.md.
The bui-lua host embeds Lua 5.4 and exposes the whole kit as a native
module — every widget, every event. This is a shortened
bindings/lua/examples/counter.lua: a
label and buttons in a native window.
local bui = require("bui")
local root = bui.Node("frame")
root:set("padding", 12)
local label = bui.Node("label")
label:set("text", "Count: 0")
root:add(label)
label:geom(bui.GEOM_PACK, {side = 0, fill = 1})
local count = 0
local inc = bui.Node("button")
inc:set("text", "Increment")
inc:set("icon", bui.icon_id("ADD"))
inc:on(bui.EV_CLICK, function()
count = count + 1
label:set("text", "Count: " .. count)
end)
root:add(inc)
inc:geom(bui.GEOM_PACK, {fill = 1, pady0 = 4})
local ctx = bui.Context(root)
local win = bui.Window(ctx, "Counter", 240, 200)
if win then
win:show()
bui.run()
else
local px, _, w, h = ctx:render(240, 200, 1)
print("No window system. Headless render: " .. w .. "x" .. h .. " " .. #px .. " bytes")
end
cmake -S . -B build -DBUI_BUILD_LUA_BINDINGS=ON
cmake --build build --target bui-lua
./build/bindings/lua/bui-lua bindings/lua/examples/counter.lua
The window below is a bigger program than the one above, an interactive Lua table editor with a tree view, search, undo/redo and export:
A bigger Lua program: the interactive table editor (bindings/lua/examples/lua_table_editor.lua)
Without a window system the same script renders headless (bui-lua --headless app.lua), which is also how the Lua tests and documentation screenshots
work; all 27 examples run this way. Guide:
bindings/lua/README.md.
your code: tkinter Qt components Dear ImGui (C++/C/Python/Rust) Rust: rsx! / HTML / CSS / Tailwind / hooks JS / React
│ │ │ │ │ │
└──── Python: options, signals │ ImGui core + BUI backend └── style cascade + taffy layout ◄────┘
│ │ │
C kit (kit/): node tree · geometry · input & interaction · Blender widget drawing · undo · animation · themes · Blender search/expr
│
renderer: damage-driven software raster (parallel) or GPU (Direct3D 11 / OpenGL 3.3, instanced, opt-in)
│
window: native Win32 / X11 / Cocoa window · stdlib Tk window · headless (tests, screenshots)
What's under the hood:
interface_widgets.cc (round_box_edges, widgetbase_draw, the shape
tables), and interaction follows interface_handlers.cc. Color math, rects,
text cursors, string search and expression evaluation are Blender's
blenlib, copied in. A few interface files (string search, text-edit undo,
float precision) are copied into kit/intern/blender/ and edited for the
kit. The X11 and Cocoa hosts follow Blender's GHOST; the Win32 host is BUI's
own.More: ARCHITECTURE.md and How it works.
These rules live in the C kit, so they work the same everywhere Blender
widgets are drawn: the Python components, tkinter and Qt syntax, the Rust and
JavaScript Blender components and form controls inside styled, ImGui's
Blender-widgets build, and every C kit widget.
expr_pylike_eval.cc) turns 2*pi, 90/4, min(4, 3) or
x if c else y into numbers. This works in Blender number fields and
sliders; plain text fields keep what you type as text.- negates,
Ctrl+Wheel steps, Ctrl+C / Ctrl+V copy and paste, right-click opens Copy,
Paste and Reset.editors/screen): drag the edge between two areas
to resize them (Shift: every aligned edge, Ctrl: snap, Esc or right-click:
cancel); drag an area's corner inward to split it, into a neighbor to join,
into any other area to dock beside it or replace it, out of the window to
ask the host to open it in a window of its own; Ctrl-drag swaps two areas; Ctrl+Space maximizes and
Ctrl+Alt+Space is focus mode; right-click an edge or a header for the same
as menus. Regions resize from their inner edge, hide when dragged closed,
come back from their tab or hotkey, and flip sides.Coming soon: typing values with units ("2 m"), Blender's search-as-you-type popups, and widget drag and drop. More: Blender's widgets.
In Rust and JavaScript you pick the look per element:
| You write | You get |
|---|---|
Plain HTML: <button>, <input type="range">, <select> ... |
What a browser draws: black text on white and Chrome's form controls, in the Inter UI font |
styled on any element: <div styled>, div().styled() |
Blender's look for it and everything inside: Blender's theme (dark or light), UI font, Blender widgets |
Blender components (capitalized): <NumberSlider>, <Button> ... |
Blender's widgets and interaction everywhere (drag to scrub, Ctrl+Z, Blender's color picker) |
The components are Button, Checkbox, Radio, NumberField, NumberSlider,
TextField, TextArea, ColorSwatch, Dropdown and ProgressBar. Each one
is the HTML element it stands for, so every attribute, style and event works on
it:
rsx! {
<main class="p-4 flex gap-2"> // browser look
<input type="range" /> // Chrome's slider
<NumberSlider min={0.0} max={10.0} value="2.5" /> // Blender's slider
<div styled><button>"Apply"</button></div> // Blender's look inside
</main>
}
div().child(Checkbox().checked(true)).child(Button().child("Apply")) // gpui syntax
import { render, NumberSlider, Button } from "@blender-ui/react"
// <NumberSlider min={0} max={10} onChange={...} />, <Button onClick={...}>Apply</Button>
// DOM API: win.createElement("NumberSlider")
cargo run --example forms: plain HTML, inside styled, and the Blender components
The same markup, plain (left) and inside styled (right). Plain HTML looks the same in both themes.
Blender components from Rust (site_components.rs)
Python's Blender components (Panel, PieMenu, the node
editor ...) are a separate, larger set.
BUI has two renderers, and they draw the same pixels.
gpu/intern/gpu_raster.c) is the default. It draws
anti-aliased shapes with signed-distance coverage, like Blender's widget
shaders, into one frame buffer, compares it with the last frame in 64×32
tiles, and reports only the tiles that changed. Big canvases draw in
parallel bands on Windows (BUI_RASTER_THREADS). It needs nothing from your
graphics card and uses the least memory.gpu/intern/gpu_d3d11.c) and OpenGL 3.3 core on Linux
(gpu/intern/gpu_gl.c). It's modeled on Blender's instanced widget drawing:
each primitive is one 128-byte instance of a single uber-shader, so a frame
is a few instanced draw calls. Text and images are cached in atlases.
Frames render into a persistent target, so only damaged regions redraw; on
Windows, a flip-model swap chain presents dirty rectangles. On Linux,
libGL, libEGL and libX11 are loaded at run time (GLX for windows, EGL
for offscreen), so no GL headers are needed, and BUI falls back to the CPU
where OpenGL is missing. On both platforms the device starts on a worker
thread, and the first frames draw on the CPU.The shaders evaluate the software raster's formulas: the parity test finds 10 of 172,800 pixels that differ by more than 3/255, on both backends.
Turn the GPU on:
| Where | How |
|---|---|
| Python | bui.set_gpu(True) before creating windows; tkinter syntax also tk.Tk(gpu=True) |
| Rust | Application::new().gpu(true), or WindowOptions { gpu: Some(true), .. } |
| JavaScript | new App({ gpu: true }), or React's render(..., { gpu: true }) |
| C | BUI_gpu_set_default(1), or BK_window_set_gpu(win, 1) |
| Any app, no code change | BUI_GPU=1 |
BUI_GPU=1 overrides the app-wide setting in code; BUI_GPU=0 turns the
app-wide defaults off, but a window that asks for the GPU itself still gets
it. Where no device can start, BUI quietly stays on the CPU
(BUI_GPU_DEBUG=1 says why).
Which one? A tool window, form or settings panel: the CPU (lightest on memory, idles at zero). A large or HiDPI window, lots of animation, thousands of items: the GPU (about half the CPU per frame, or less, for about 10 MB more RAM plus GPU memory). Servers and tests: the CPU. macOS: the CPU, for now (a GPU renderer there is coming soon).
More: Rendering.
Leave a BUI window open and walk away: it uses no CPU at all. Hover a button, and BUI redraws that button, not the window.
XPutImage, Cocoa invalidates them, the GPU presents dirty
rectangles).On the full component demo, that's about 0.7 ms for a complete frame and about 0.05 ms for a hover or number-scrub frame. Animations run only while something moves, paced to the display. More: Damage rendering.
A window host puts a kit context in a top-level window and feeds it input.
| Host | Where | Notes |
|---|---|---|
Win32 (kit_window_win32.c) |
Windows | BUI's own host. Per-monitor DPI, vsync-paced animation, clipboard, cursors, window-manager features. |
X11 (kit_window_x11.c) |
Linux (also Wayland, via XWayland) | Input mapping after Blender's GHOST. Xft.dpi scaling. libX11 is loaded when the first window opens. |
Wayland (kit_window_wayland.c) |
Linux, experimental | Native Wayland windows, after Blender's GHOST_SystemWayland: xdg-shell, server-side decorations when offered, wl_seat with xkbcommon, clipboard, cursors, buffer scale, frame callbacks. CPU renderer only: with the GPU renderer on (BUI_GPU=1) a Wayland session keeps using X11 through XWayland. BUI_WINDOW_BACKEND=x11|wayland picks one. libwayland loads at run time (Blender's wayland_dynload). Needs the Wayland headers to build; without them Linux windows are X11 only. |
Cocoa (kit_window_cocoa.m) |
macOS | Ported from Blender's GHOST Cocoa code, with Retina scaling. It's checked by CI and has been tried by hand on three Macs (two Apple Silicon, one Intel); testing notes in docs/macos-testing.md. |
| Tk | Python, anywhere | A stdlib tkinter window that shows the kit's frame buffer. BUI_HOST=tk forces it; it's also the fallback where no native host works. |
| Headless | Everywhere | No window: render into a raster for tests and screenshots, with a virtual clock that steps animations exactly. |
BUI_UI_SCALE=1.5 fixes the UI scale instead of following the display (1 is
Blender's default, 20 px widgets). More:
Window hosts.
Your app's text looks the same on Windows, Linux and macOS, and it looks like Blender's:
BUI_TEXT_FREETYPE=OFF, stb_truetype rasterizes instead.BUI_SLUG=0, bui.set_slug(False),
.slug(false), BUI_gpu_set_slug(0)).BUI_FONT=path.ttf replaces Inter, BUI_FONT_DIR adds a
folder to search first, blenderui::add_font (Rust) and
BUI_text_add_font (C) register faces from memory, and CSS @font-face
loads local files.-DBUI_TEXT_GDI=ON, Rust feature
gdi-text): ClearType-style hinting and system fonts, without Slug.Characters the font lacks (Hangul, kana, Han, Thai, Indic, symbols) are drawn
glyph by glyph from the rest of the font-family list, then the system's font
for the script, and installed fonts are found by their own family names (an
installed Arial before the sans stand-ins). Limits
worth knowing: IME on Windows only (X11 and macOS are coming), right-to-left
text is reordered but not shaped, no OpenType features. More:
Text and fonts.
ppmpreetham/BUI is a public repo on GitHub by ppmpreetham. Blender's GPU Accelerated UI, Decoupled from it's original codebase. Supports Rust, Python, JS, Lua, C & C++. Twice as good as GPUI.
It declares the GPL-3.0 license on GitHub.
Its maker tagged it for macOS, Windows and Linux, or as Docker or cross-platform. That is declared by the maker; Take My Repo has not tested it.
Open "Take it" on its page: Take My Repo writes an install plan for your machine and hands it to your AI agent (Claude Code, Codex or Cursor), which asks you before each step. Take My Repo has not tested it on any machine.
Its last change on GitHub was on 2026-11-23. GitHub counts 12 open issues and pull requests. Take My Repo does not judge from that whether it is maintained.
Nobody has reviewed it on Take My Repo yet, which says nothing about its quality.

Community plugin to control Blender 3D with any LLM of your choice. Not affiliated with the official Blender Foundation.
Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Blender addons to make the bridge between Blender and geographic data
⚡️A native, local-first alternative to Logitech Options+, written in Rust 🦀 — remap buttons, DPI, and SmartShift over HID++. No account, no telemetry.
Rust GUI components for building fantastic cross-platform desktop application by using GPUI.
⚡FastAPI alternative for Python, but actually (~6x) FASTER. Written in Rust.
👨🏻💻 Superfast OSINT engine to hunt people based on usernames (FASTEST YET) ~ 20sec
Comprehensive ANSI escape codes cheat-sheet for easy reference
This page is also available as structured data, with the same sources and dates.
/api/v1/resources/gh/ppmpreetham/BUITake My Repo has not tested this on your machine. Requirements come from the project's own documentation.