开发者 ppmpreetham 推出了名为 BUI (Blender User Interface) 的独立图形用户界面库,旨在将经过数十年优化的 Blender UI 代码解耦并封装 1。该库以 C 语言为核心运行时,通过薄层绑定支持 Python、Rust、JavaScript/React、C/C++ 及 Dear ImGui 等多种编程语言 1。项目代码完全由大型语言模型(LLM)编写,但由于其绘制和交互逻辑源自 Blender 的 GPL 许可源代码,因此遵循 GPL-2.0-or-later 许可证 1。
在性能表现上,基准测试显示 BUI 相比 gpui-fast 每帧 CPU 使用率低 2–4 倍,内存占用更少,首帧渲染时间约为 5 ms 1。该库采用“损坏区域渲染”技术,空闲状态下窗口 CPU 占用率为 0%,仅重绘发生变化的矩形区域 1。此外,BUI 内置了针对 PNG、GIF、JPEG、WebP 等格式的优化图像解码器,缩略图生成耗时约 12 ms 1。
为了提升开发效率与兼容性,BUI 提供了 tkinter 语法兼容层,覆盖了全部 7,846 个公共名称,使得现有程序无需修改即可直接运行 1。在 Rust 环境中,它支持 rsx! 宏和 gpui 构建器语法;而在 JavaScript 环境中,则兼容 React 19.3 和原生 DOM API,生成的独立可执行文件体积仅约 7 MB 1。虽然默认使用 CPU 软件光栅化以节省内存,但该库也提供可选的 GPU 渲染器,分别支持 Windows 上的 Direct3D 11 和 Linux 上的 OpenGL 3.3 1。
Developer ppmpreetham has released BUI (Blender User Interface), a standalone cross-language GUI library that decouples and encapsulates Blender’s decades-optimized user interface code. 1 The project aims to deliver faster startup times, lower memory usage, and higher CPU/GPU rendering efficiency compared to existing frameworks like GPUI, while preserving Blender’s unique interaction features such as drag-to-adjust values and fuzzy menu search. 1 Built around an independent C core runtime, BUI supports bindings for Python, Rust, JavaScript/React, C, C++, and Dear ImGui. 1
Performance benchmarks indicate that BUI uses 2–4 times less CPU per frame than gpui-fast, consumes less RAM, and achieves a first-frame render time of approximately 5 milliseconds. 1 The library employs "Damage rendering" technology, resulting in 0% CPU usage when idle by only redrawing changed rectangular regions. 1 For compatibility, BUI covers all 7,846 public names in tkinter syntax, allowing existing programs to run without modification. 1 Additionally, the system includes optimized image decoders for PNG, GIF, JPEG, and WebP formats, with thumbnail generation taking about 12 milliseconds. 1
BUI defaults to CPU software rasterization to save memory but offers optional GPU renderers, specifically Direct3D 11 on Windows and OpenGL 3.3 on Linux. 1 Language-specific features include support for rsx! macros and gpui builder syntax in Rust, and React 19.3 plus native DOM API in JavaScript, which produces standalone executables of roughly 7 MB. 1 While the codebase was entirely written by LLMs, the drawing and interaction logic derives from Blender’s GPL-licensed source code, meaning the project follows the GPL-2.0-or-later license. 1
评论
还没有评论,欢迎留下第一条。