BUI: Decoupling Blender's UI for High-Performance Cross-Platform Applications
A new standalone library brings Blender's efficient widget system to Python, Rust, and JavaScript.
1Blender UI Decoupled
BUI transforms Blender’s decades-old user interface into a standalone library. By isolating the widget drawing and interaction logic into a small C core, developers can now utilize Blender’s famous interface feel in external products. It supports multiple languages, including Python, Rust, and JavaScript, without requiring a browser or webview engine.
2Core Runtime Architecture
The heart of BUI is a lightweight C runtime called the kit. This component manages the widget tree, handles layout, and processes mouse and keyboard inputs using Blender’s established interaction rules. Thin language bindings allow developers to interface with this native core from various frameworks like React, Svelte, and Dear ImGui.
3Performance and Efficiency
BUI is designed for extreme efficiency, featuring damage-based rendering that consumes zero CPU when idle. It redraws only the specific widgets affected by user interaction. Benchmarks indicate that BUI requires two to four times less CPU per frame compared to gpui-fast, while maintaining lower memory usage and rapid startup times.
4Native Feel and Interaction
The library replicates Blender’s unique interaction patterns, such as continuous cursor dragging in number fields and fuzzy menu searching. These habits are deeply ingrained in millions of artists. By adopting BUI, applications gain access to these advanced features, including math expression evaluation, pie menus, and multi-field vertical dragging capabilities.
5Cross-Language Integration
Developers can integrate BUI using familiar syntax from existing tools. Python users can leverage tkinter or Qt-like syntax, while Rust developers gain access to a web-like platform with modern CSS support. JavaScript bindings enable React 19.3 and Svelte 5 to render native UIs, bypassing the overhead of traditional browser-based rendering stacks.
6Advanced Image Handling
BUI features a memory-budgeted cache and a robust image decoder set written in C. It handles various formats like PNG, JPEG, and WebP off the UI thread to prevent interface lag. Animated GIFs and WebP files are decoded frame-by-frame, ensuring smooth performance even when displaying hundreds of thumbnails simultaneously.
7Video Playback Capabilities
Video integration is handled via OS-native decoders like Media Foundation or GStreamer. Frames are updated in place within GPU textures, minimizing memory allocations. A 1080p video playback consumes approximately 0.99 ms of render time per frame, allowing for multiple simultaneous video streams with minimal impact on the application's overall CPU usage.
8Modern CSS Support
Rust developers using BUI benefit from a modern CSS implementation, including flexbox, grid layouts, and Tailwind CSS v4 support. The library supports complex features like calc(), color-mix(), and backdrop-filter. This allows for sophisticated styling and animations without the need for a full web browser, keeping the final executable size remarkably small.
9Standalone Binary Deployment
Applications built with BUI are highly portable, producing small executables ranging from 6.3 MB to 6.9 MB. By utilizing a feature-based table, the build process links only the necessary runtime components. This approach eliminates external dependencies, allowing for rapid deployment and first-frame rendering in approximately 70 milliseconds on standard hardware.
10Dear ImGui Compatibility
BUI provides full support for Dear ImGui 1.93, allowing developers to use its functions across C++, C, Python, and Rust. Users can choose between standard ImGui visuals or pixel-identical Blender widgets. This flexibility enables developers to maintain a consistent look and feel while leveraging the performance benefits of the BUI runtime.
11Platform Native Support
The library supports native windows on Windows via Win32 and Linux through X11 or Wayland. An experimental Cocoa host is available for macOS, ported from Blender’s GHOST. BUI also includes a headless mode for automated testing and screenshot generation, utilizing a virtual clock to ensure precise animation timing during headless execution.
12Implementation and Installation
Installation is streamlined through standard package managers like pip for Python and cargo for Rust. The library is designed to be developer-friendly, with prebuilt wheels available for major operating systems. For C and C++ projects, BUI can be integrated as a CMake subdirectory, providing direct access to the kit and imgui libraries.