UMG 程序化 UI 生成能力缺失的系统性问题(建议增加官方 Widget IR 与编辑器 API) Missing System-Level Support for Programmatic UI Generation in UMG (Request for Widget IR & Editor APIs)

Title / 标题
UMG 程序化 UI 生成能力缺失的系统性问题(建议增加官方 Widget IR 与编辑器 API)
Missing System-Level Support for Programmatic UI Generation in UMG (Request for Widget IR & Editor APIs)


Background / 背景
当前 UMG 在运行时(Runtime)具备较完整的动态 UI 构建能力,但在编辑器(Editor / Designer)侧,对于程序化生成 UI 的支持存在明显缺口。这使得 AI 驱动 UI、自动化工具链、以及数据驱动 UI 工作流难以落地。

UMG provides solid runtime UI construction capabilities, but lacks proper editor-side APIs for programmatic UI generation. This creates major limitations for AI-driven UI, automation pipelines, and data-driven workflows.


Current Capabilities / 现有能力

Runtime(运行时)
:check_mark: 可构建完整 WidgetTree
:check_mark: 可动态 AddChild / 设置布局
:check_mark: 可用于游戏内 UI 动态生成

Runtime
:check_mark: Full WidgetTree construction is supported
:check_mark: Dynamic AddChild and layout configuration
:check_mark: Suitable for runtime UI generation in games


Editor(编辑器)
:warning: 只能有限读取 WidgetTree
:warning: 写入 Designer 需要非公开 API + Hack
:cross_mark: 无序列化 / 反序列化能力
:cross_mark: 无稳定批量操作能力
:cross_mark: 无 BindWidget 可控机制

Editor
:warning: Limited ability to read WidgetTree
:warning: Writing into Designer requires internal APIs and hacks
:cross_mark: No serialization / deserialization support
:cross_mark: No stable batch operation APIs
:cross_mark: No controllable BindWidget mechanism


Core Gaps / 核心缺口

1. 缺少 Widget IR(中间表示)
没有类似 JSON / DSL 的官方 UI 描述格式,导致 UI 无法数据驱动生成。

No official intermediate representation (such as JSON or DSL) for UI, preventing data-driven UI generation.


2. 无稳定的 Designer 写入 API
当前只能通过内部 API(不稳定)修改 WidgetTree。

There is no stable public API to modify the WidgetTree in the Designer.


3. BindWidget 黑盒机制
无法查询、修复或局部触发绑定。

The BindWidget system is opaque and cannot be queried, repaired, or partially triggered.


4. 无法做增量写入(最严重)
程序生成 UI 在 Blueprint 编译或重新打开后可能丢失。

There is no non-destructive incremental update pipeline; programmatically generated UI may be lost after recompilation or reopening.


What This Blocks / 实际影响

  • AI 自动生成 UMG UI(核心阻塞)

  • UI JSON / DSL 工作流

  • 可版本控制的 UI(文本 diff)

  • UI 工具链(设计工具 → UE)

  • 批量 UI 自动化

  • AI-driven UMG UI generation (critical blocker)

  • UI JSON / DSL workflows

  • Version-controllable UI (text-based diff)

  • UI toolchains (design tools → Unreal Engine)

  • Large-scale UI automation


Requested Features / 期望能力

1. Widget 序列化 API

FString Json = UWidgetSerializer::ToJson(Blueprint);
UWidgetBlueprint* BP = UWidgetSerializer::FromJson(Json);

1. Widget Serialization API

FString Json = UWidgetSerializer::ToJson(Blueprint);
UWidgetBlueprint* BP = UWidgetSerializer::FromJson(Json);


2. Designer 写入 API

IWidgetDesignerAPI::AddWidget(...)

2. Designer Write API

IWidgetDesignerAPI::AddWidget(...)


3. BindWidget 查询接口

GetUnresolvedBindings(Blueprint)

3. BindWidget Query API

GetUnresolvedBindings(Blueprint)


4. 增量安全写入机制(最关键)
允许程序生成 UI 与手工 UI 共存。

4. Non-destructive Incremental Update (Most Critical)
Allow programmatically generated UI to coexist with manually created UI.


Supplementary Note / 补充说明

中文:
需要特别指出的是,UMG Designer 与底层庞大的程序逻辑体系在复杂度上是完全不同的两个层级。相比之下,Designer 本质上只涉及 Widget 分类(Category)与属性(Property)配置,并不承担复杂的逻辑判断或运行时行为。因此,从工程角度来看,我们所期望的编辑器 API,并不需要覆盖完整的运行时能力,只需提供围绕 Designer 层级的增、删、查、改(CRUD)操作即可。

一旦这一基础能力被官方支持,其余更高层的能力(如 UI 自动生成、AI 驱动设计、批量工具链等)完全可以由插件与 LLM 在外部实现与扩展。这将以极低的实现成本,撬动极高的工程价值与生产力提升,是一个投入产出比极高的方向。


English:
It is important to highlight that the UMG Designer operates at a fundamentally different level of complexity compared to the underlying runtime and logic systems. The Designer primarily deals with widget categorization and property configuration, without involving complex logic or runtime behavior.

From an engineering perspective, the APIs we are requesting do not need to replicate full runtime capabilities. Instead, it would be sufficient to expose a stable set of CRUD operations (Create, Read, Update, Delete) for the Designer-level widget hierarchy.

Once this foundational capability is provided, higher-level systems—such as AI-driven UI generation, automated pipelines, and external tooling—can be fully implemented by plugins and LLM-based solutions. This represents a high-leverage improvement with an extremely favorable cost-to-impact ratio.


Conclusion / 总结

UMG 当前本质上是一个“人工编辑工具”,而不是“数据驱动 UI 系统”。缺少 UI IR 与编辑器 API,使其难以融入现代 AI 与自动化工作流。

UMG is fundamentally designed as a manual editing tool rather than a data-driven UI system. Without a Widget IR and proper editor APIs, it cannot integrate into modern AI-driven and automated workflows.


Final Note / 最后说明

这不是单一 API 的问题,而是缺少完整的“程序化 UI 描述层”。建议从系统层面补齐:

Widget IR + Editor API + Binding Control

This is not about a single missing API, but the absence of a full programmatic UI layer. A system-level solution should include:

Widget IR + Editor API + Binding Control