Blender's UI and Runtime: Much Faster Than GPUI
740 points
• 6 days ago
• Article
Link
BUI 是一个独立的 UI 库,它从 Blender 中提取了高度优化的 Widget 绘制与交互系统。通过将这些组件从 Blender 的核心代码库中解耦,该项目让开发者能够跨多种编程语言(包括 Python 、 Rust 、 JavaScript 、 C 和 C++)构建高性能、低功耗的桌面应用。它基于一个轻量级的 C 运行时(kit)运作,用来管理 Widget 树、布局、输入处理与渲染。
该库提供基于 Blender 著名交互模型的统一用户体验。核心功能包括拖动式数值微调、在输入框内对数学表达式进行求值、模糊菜单搜索以及完善的撤销支持。由于 BUI 采用模块化设计,它支持多种渲染后端:既有高效的软件光栅化器,也提供使用 Direct3D 11 或 OpenGL 3.3 的硬件加速方案。借助损伤渲染架构,BUI 只重绘发生变化的区域,从而确保空闲状态下的应用几乎不占用 CPU 资源。
开发者可以从多个入口使用该库。对 Python 用户而言,BUI 能与现有 tkinter 和 ttk 应用实现近乎无缝的兼容,无需改动代码,并支持 Qt 风格语法以及一套原生的 Blender 组件。 Rust 与 JavaScript 开发者则可使用类似 Web 的框架,这些框架支持 HTML 、 CSS 和 Tailwind,同时还可以在特定场景中集成原生的 Blender Widget 。此外,该库还提供 Dear ImGui 的后端,让开发者可以把该界面与 Blender 的主题结合使用,甚至可以用 Blender 的原生组件替换其标准 Widget 。
性能是该项目的重点:库设计为快速、内存高效,并能以极低开销处理复杂界面。它对图像与视频提供了强大的支持,包括离线程解码,以及带内存预算的缓存,用于避免性能瓶颈。作为独立方案,BUI 避免了基于浏览器运行时的臃肿,使得开发者能够创建体积紧凑、启动迅速、同时保持原生感与良好响应性的应用。
该项目持续进行维护,模块化架构也鼓励贡献与提升透明度。尽管部分功能(例如 macOS 窗口支持与 Qt 语法覆盖)仍处于实验或不完整阶段,但核心的 C 运行时以及主要语言绑定已可用并经过测试。开发者可通过官方网站获取完整文档,内容涵盖安装流程、各语言指南以及性能基准,帮助团队评估如何将 BUI 最好地集成到现有工作流中。
BUI is a standalone user interface library that extracts the highly optimized widget drawing and interaction systems from Blender. By decoupling these components from Blender's core codebase, the project allows developers to build high-performance, battery-efficient desktop applications across multiple programming languages, including Python, Rust, JavaScript, C, and C++. It operates via a lightweight C runtime, known as the kit, which manages the widget tree, layout, input handling, and rendering.
The library provides a consistent user experience based on Blender's famous interaction model. Key features include drag-to-scrub number fields, mathematical expression evaluation within inputs, fuzzy menu searching, and comprehensive undo support. Because BUI is built to be modular, it supports multiple rendering backends, including a highly efficient software rasterizer and hardware-accelerated options using Direct3D 11 or OpenGL 3.3. Through a damage-rendering architecture, BUI only redraws regions that have changed, ensuring that idle applications consume virtually no CPU resources.
Developers have several entry points to the library. For Python users, BUI offers near-perfect compatibility with existing tkinter and ttk applications without requiring code changes, alongside support for Qt-style syntax and a set of native Blender components. Rust and JavaScript developers can utilize web-like frameworks that support HTML, CSS, and Tailwind, combined with the ability to integrate native Blender widgets for specific tasks. Additionally, the library provides a backend for Dear ImGui, allowing developers to use that interface with Blender's theming or even replace its standard widgets with Blender's native counterparts.
Performance is a central focus of the project, with the library designed to be fast, memory-efficient, and capable of handling complex interfaces with minimal overhead. It includes robust support for images and video, featuring off-thread decoding and memory-budgeted caching to prevent performance bottlenecks. As a standalone solution, BUI avoids the bloat of browser-based runtimes, enabling the creation of compact, fast-starting applications that maintain native feel and responsiveness.
The project is actively maintained with a modular architecture that encourages contribution and transparency. While some features like macOS window support and Qt syntax coverage remain in experimental or partial stages, the core C runtime and primary language bindings are functional and tested. Developers can access full documentation through the official website, which covers installation, language-specific guides, and performance benchmarks to help teams determine how best to integrate BUI into their existing workflows.
294 comments • Comments Link
• 一份简洁、清晰的 README 对项目是否被采用以及能否吸引开发者兴趣至关重要。它应当优先呈现高层级的概述与输入输出示例,而不是着重堆叠技术实现细节。
• Blender 的界面在历史上虽饱受争议、且复杂度很高,但由于其高度可定制、能高效地进行屏幕分割,并且工作流相对一致,因此仍赢得了部分人的青睐,也由此激发了把其实际控件逻辑移植到其他专业级软件的兴趣。
• 在 Blender 的 UI 问题上,用户通常分成两派:一派认为它优雅、且在处理"prosumer"类任务时能力强大;另一派则觉得它过于困难且没必要。无论他们是其他 3D 软件的老手,还是新手,分歧都很常见。
• 复杂的 3D 软件 UI 往往经历了数十年的演进。为了在海量功能之间做取舍,它们的本质更接近"混乱",因此也很难与 ImGui 、 GPUI 这类通用 GUI 库直接对比。
• "baby duck syndrome"是影响 UI 偏好的关键因素之一。用户往往会对自己学会的第一个界面产生强烈的情感依恋,从而抵制专业工具中哪怕是客观上有益的设计变更。
• 将 Blender 中已经经过实战检验的现有 UI 代码以库形式移植,可以为那些厌倦了从零开始重做复杂布局与交互逻辑的开发者提供一条潜在捷径。不过,这同时也伴随继承原项目"文化包袱"的风险。
• 借助 LLMs 把复杂的 C 代码迁移到新的库中,被认为是一种"高杠杆"的做法:它能让那些原本可能缺少时间或动力的人实现更雄心的项目目标。但这也带来了对项目寿命与可维护性的担忧。
• 许可协议仍然是阻碍广泛采用的主要因素之一。由于 Blender 源代码采用 GPLv3,想把该库用于专有产品或采用不同许可的商业应用的开发者,会面临相应的法律限制。
• 可访问性(a11y)经常在新的 GUI 框架中被忽视。如果没有把它纳入路线图或纳入初始实现,这类工具在更广泛的通用软件开发场景中的效用就会被显著削弱。
• 支持"原生"UI 工具包的论点正日益被视为过时或不切实际。原因在于现代跨平台的专业级应用——就算是来自 Apple 等公司的产品——通常也会选择自定义的、高密度的 UI,而不是依赖标准系统控件,以维持工作流效率。
这场讨论反映了开发者社区中一种根深蒂固的矛盾:一方面,人们渴望软件拥有连贯一致的"原生感";另一方面,专业级工具又确实需要高密度、强可定制的界面。尽管不少人表达了对 Blender 等复杂软件中特定 UI 范式的认可,但整体共识是,这类模式并非"一刀切",可能并不适合通用应用的开发。对话也强调了 LLMs 在加速创建小众开发者工具方面影响力日益增长,并把这种趋势与对维护成本、可访问性,以及基于衍生、由非人类编写的代码库所构建项目长期生存能力的持续担忧放在同一讨论框架里。总体来看,共识意味着:尽管"原生"UI 的理想在理论上仍然成立,但现代软件开发的现实更倾向于优先追求速度、界面密度与专业功能,而非严格遵循平台特定的设计规范。 • A clean, concise README that prioritizes a high-level pitch and input-output examples over technical implementation details is critical for project adoption and developer interest.
• Blender's interface, while historically polarizing and highly complex, is admired by some for its extreme customizability, efficient screen-splitting, and consistent workflow, leading to interest in porting its widget logic to other professional-grade software.
• Users generally fall into two camps regarding Blender's UI: those who find it elegant and highly functional for "prosumer" tasks, and those who perceive it as needlessly difficult, regardless of whether they are veterans of other 3D software or newcomers.
• Complex 3D software UIs often evolve over decades and are inherently messy due to the trade-offs required to manage massive feature sets, making them difficult to compare directly to general-purpose GUI libraries like ImGui or GPUI.
• The "baby duck syndrome" is a significant factor in UI preferences, where users become deeply attached to the first interface they master, leading to resistance against even objectively beneficial design changes in their professional tools.
• Porting existing, battle-tested UI code from Blender into a library format offers a potential shortcut for developers tired of reimplementing complex layout and interaction logic from scratch, though it risks inheriting the "cultural baggage" of the original project.
• Relying on LLMs to port complex C code into a new library is viewed as a high-leverage way to enable projects that humans might not otherwise have the time or incentive to pursue, though it raises questions about project longevity and maintenance.
• Licensing remains a primary hurdle for widespread adoption, as the GPLv3 requirement from Blender's source code creates legal constraints for developers seeking to use this library in proprietary or differently-licensed commercial applications.
• Accessibility (a11y) is a frequently overlooked requirement in new GUI frameworks, and failing to include it on the roadmap or in the initial implementation limits the utility of such tools for broader, general-purpose software development.
• The argument for "native" UI toolkits is increasingly seen as outdated or impractical, as modern cross-platform pro-grade applications (even those from companies like Apple) often choose custom, dense UIs over standard system-provided widgets to maintain workflow efficiency.
The discussion reflects a deep-seated tension in the developer community between the desire for cohesive, native-feeling software and the practical need for dense, highly customizable interfaces in professional-grade tools. While many express appreciation for the specialized UI patterns found in complex software like Blender, there is widespread recognition that such paradigms are not "one-size-fits-all" and may not be suitable for general application development. The conversation also highlights the growing influence of LLMs in accelerating the creation of niche developer tools, juxtaposed with persistent concerns about maintenance, accessibility, and the long-term viability of projects built on derivative, non-human-authored codebases. Overall, the consensus suggests that while "native" UI ideals persist in theory, the reality of modern software development favors tools that prioritize speed, density, and specialized functionality over strict adherence to platform-specific design conventions.