ue5-editor-control

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

UE5 Editor Control

UE5编辑器控制

HTTP API for the UE5 editor. Plugin
UE5AIAssistant
runs on
localhost:58080
.
用于UE5编辑器的HTTP API。插件
UE5AIAssistant
运行在
localhost:58080

Auto-Setup Flow (MUST follow on first use)

自动设置流程(首次使用必须遵循)

Every time you need to use this skill, start here:
每次需要使用该技能时,请从这里开始

Step 1: Check if plugin is already running

步骤1:检查插件是否已运行

bash
curl -s --max-time 3 http://localhost:58080/api/ping
  • If response contains
    "success": true
    Skip to Quick Start below
  • If connection refused / timeout → Plugin not running, continue to Step 2
bash
curl -s --max-time 3 http://localhost:58080/api/ping
  • 如果响应包含
    "success": true
    跳至下方的快速开始
  • 如果连接被拒绝/超时 → 插件未运行,继续步骤2

Step 2: Find user's UE5 project

步骤2:查找用户的UE5项目

Ask the user: "你的 UE5 项目路径是什么?"
Or auto-detect (look for
.uproject
files):
bash
undefined
询问用户:"你的 UE5 项目路径是什么?"
或自动检测(查找
.uproject
文件):
bash
undefined

macOS common locations

macOS常见位置

find ~/Documents ~/Desktop ~/Projects ~/codeprojects -maxdepth 3 -name "*.uproject" 2>/dev/null

Save the project path for later use.
find ~/Documents ~/Desktop ~/Projects ~/codeprojects -maxdepth 3 -name "*.uproject" 2>/dev/null

保存项目路径以备后用。

Step 3: Check if plugin is installed in the project

步骤3:检查项目中是否已安装插件

bash
undefined
bash
undefined

Check if plugin exists in the UE5 project

检查UE5项目中是否存在插件

test -f "<UE5_PROJECT_PATH>/Plugins/UE5AIAssistant/UE5AIAssistant.uplugin" && echo "INSTALLED" || echo "NOT INSTALLED"

- If `INSTALLED` → Tell user: **"插件已安装,请打开 UE5 编辑器然后告诉我"**
- If `NOT INSTALLED` → Continue to Step 4
test -f "<UE5_PROJECT_PATH>/Plugins/UE5AIAssistant/UE5AIAssistant.uplugin" && echo "INSTALLED" || echo "NOT INSTALLED"

- 如果显示`INSTALLED` → 告知用户:**"插件已安装,请打开UE5编辑器并告知我"**
- 如果显示`NOT INSTALLED` → 继续步骤4

Step 4: Install the plugin

步骤4:安装插件

Option A — Download prebuilt binary (recommended, no C++ required):
bash
bash scripts/install.sh "<UE5_PROJECT_PATH>"
If this fails (no releases published yet), fall back to Option B.
Option B — Copy source code (requires UE5 C++ compilation):
The skill's GitHub repo contains the C++ source. Clone and copy:
bash
undefined
选项A — 下载预编译二进制文件(推荐,无需C++环境):
bash
bash scripts/install.sh "<UE5_PROJECT_PATH>"
如果此方法失败(暂无发布版本),则回退到选项B。
选项B — 复制源代码(需要UE5 C++编译环境):
该技能的GitHub仓库包含C++源代码。克隆并复制:
bash
undefined

Clone the repo (if not already available)

克隆仓库(如果尚未获取)

Copy plugin source to UE5 project

将插件源代码复制到UE5项目

mkdir -p "<UE5_PROJECT_PATH>/Plugins/UE5AIAssistant" cp -r /tmp/ue5-editor-control/Source "<UE5_PROJECT_PATH>/Plugins/UE5AIAssistant/" cp /tmp/ue5-editor-control/UE5AIAssistant.uplugin "<UE5_PROJECT_PATH>/Plugins/UE5AIAssistant/"

Then tell user: **"插件已复制到项目中。请打开 UE5 编辑器,它会自动编译插件。打开后告诉我。"**
mkdir -p "<UE5_PROJECT_PATH>/Plugins/UE5AIAssistant" cp -r /tmp/ue5-editor-control/Source "<UE5_PROJECT_PATH>/Plugins/UE5AIAssistant/" cp /tmp/ue5-editor-control/UE5AIAssistant.uplugin "<UE5_PROJECT_PATH>/Plugins/UE5AIAssistant/"

然后告知用户:**"插件已复制到项目中。请打开UE5编辑器,它会自动编译插件。打开后告知我。"**

Step 5: Verify connection

步骤5:验证连接

bash
curl -s --max-time 3 http://localhost:58080/api/ping
If still failing, tell user to check:
  • UE5 editor is open with the correct project
  • Check Output Log for "UE5AIAssistant: HTTP server started on port 58080"
  • Plugin is enabled: Edit → Plugins → search "UE5AIAssistant"
bash
curl -s --max-time 3 http://localhost:58080/api/ping
如果仍然失败,告知用户检查:
  • UE5编辑器已打开并加载了正确的项目
  • 在输出日志中查找"UE5AIAssistant: HTTP server started on port 58080"
  • 插件已启用:编辑 → 插件 → 搜索"UE5AIAssistant"

Prerequisites Summary

前提条件汇总

RequirementDetail
UE55.4+ installed and project created
OSmacOS / Windows / Linux
curlPre-installed on macOS/Linux; Git Bash on Windows
UE5 EditorMust be running with plugin enabled
C++ (Option B only)Only if no prebuilt binary available for your platform
要求详情
UE5已安装5.4+版本并创建了项目
操作系统macOS / Windows / Linux
curlmacOS/Linux已预装;Windows需使用Git Bash
UE5编辑器必须已运行且插件已启用
C++环境(仅选项B需要)仅当你的平台暂无预编译二进制文件时需要

Quick Start

快速开始

bash
undefined
bash
undefined

Execute command (preferred for complex JSON)

执行命令(复杂JSON推荐使用)

curl -s -X POST -H "Content-Type: application/json"
-d '{"command":"get_actors_in_level","args":{}}'
http://localhost:58080/api/execute
curl -s -X POST -H "Content-Type: application/json"
-d '{"command":"get_actors_in_level","args":{}}'
http://localhost:58080/api/execute

Simple commands via helper

通过助手执行简单命令

bash scripts/ue5cmd.sh exec get_actors_in_level '{}'

Response: `{ "success": true|false, "data": {...}|null, "error": "..."|null }`
bash scripts/ue5cmd.sh exec get_actors_in_level '{}'

响应格式:`{ "success": true|false, "data": {...}|null, "error": "..."|null }`

Common Mistakes — Do NOT

常见错误——请勿

  • Do NOT add nodes one-by-one — always use
    batch_execute
  • Do NOT guess C++ function names — use
    list_functions
    first
  • Do NOT hardcode pin names — read them from response
    pins
    array
  • Do NOT skip
    compile_blueprint
    after editing
  • Do NOT use
    ue5cmd.sh
    for complex JSON — use
    curl
    directly
  • 请勿逐个添加节点——始终使用
    batch_execute
  • 请勿猜测C++函数名——先使用
    list_functions
  • 请勿硬编码引脚名称——从响应的
    pins
    数组中读取
  • 编辑后请勿跳过
    compile_blueprint
  • 复杂JSON请勿使用
    ue5cmd.sh
    ——直接使用
    curl

Task Router — Read the Right Module

任务路由——阅读对应模块

Based on the user's task, read only the relevant module file for detailed commands, parameters, and workflows:
User wants to...Read this file
Work with actors (spawn, delete, transform, properties)references/actor.md
Build blueprint structure & logic (create BP, variables, functions, nodes, batch_execute)references/blueprint.md
Create materials (expressions, connections, apply)references/material.md
Build animation blueprints (state machines, states, transitions)references/animation.md
Access any property via reflection, manage assets (create/read/write)references/property.md
Set up Enhanced Input, configure character movement, build end-to-end charactersreferences/input-character.md
Rules:
  1. Read only the module(s) needed for the current task — do NOT read all files
  2. If unsure which module, check the table above or read the user's intent
  3. Multiple tasks may require multiple modules (e.g., character = blueprint + input-character)
根据用户的任务,阅读相关模块文件以获取详细命令、参数和工作流:
用户想要...阅读此文件
处理Actor(生成、删除、变换、属性)references/actor.md
构建蓝图结构与逻辑(创建蓝图、变量、函数、节点、batch_execute)references/blueprint.md
创建材质(表达式、连接、应用)references/material.md
构建动画蓝图(状态机、状态、过渡)references/animation.md
通过反射访问任意属性,管理资源(创建/读取/写入)references/property.md
设置Enhanced Input,配置角色移动,构建完整角色references/input-character.md
规则:
  1. 仅阅读当前任务所需的模块——请勿阅读所有文件
  2. 若不确定哪个模块,请查看上表或解读用户意图
  3. 多个任务可能需要多个模块(例如,角色 = 蓝图 + 输入-角色)

65 Commands Overview (for quick orientation only)

65个命令概览(仅用于快速了解)

CategoryCommandsCount
Actor
get_actors_in_level
,
find_actors_by_name
,
get_selected_actors
,
spawn_actor
,
delete_actor
,
set_actor_transform
,
get_actor_properties
,
set_actor_property
,
attach_actor
,
detach_actor
10
Blueprint Structure
create_blueprint
,
compile_blueprint
,
read_blueprint_content
,
create_variable
,
add_component_to_blueprint
,
create_function
,
add_function_parameter
,
create_event_dispatcher
,
create_blueprint_interface
,
implement_interface
,
add_widget_child
11
Blueprint Discovery
list_node_types
,
list_blueprint_classes
,
list_functions
3
Blueprint Nodes
add_node
,
connect_nodes
,
remove_node
,
get_node_pins
,
set_pin_default
,
batch_execute
,
add_pin
,
auto_layout_graph
8
Material
create_material
,
add_material_expression
,
connect_material_expressions
,
apply_material_to_actor
,
get_available_materials
5
Asset
search_assets
,
get_assets_by_class
,
get_asset_details
3
Editor
focus_viewport
,
get_current_level_info
,
save_all
,
get_project_settings
,
set_project_setting
,
get_world_settings
,
set_world_setting
7
Animation
create_anim_blueprint
,
get_anim_blueprint_info
,
add_anim_state_machine
,
add_anim_state
,
add_anim_transition
,
set_anim_state_animation
,
compile_anim_blueprint
7
Generic Reflection
list_components
,
list_properties
,
get_component_property
,
set_component_property
,
create_asset
,
get_asset_property
,
set_asset_property
,
call_function
,
get_object
,
modify_array_property
,
execute_python
11
类别命令数量
Actor
get_actors_in_level
,
find_actors_by_name
,
get_selected_actors
,
spawn_actor
,
delete_actor
,
set_actor_transform
,
get_actor_properties
,
set_actor_property
,
attach_actor
,
detach_actor
10
蓝图结构
create_blueprint
,
compile_blueprint
,
read_blueprint_content
,
create_variable
,
add_component_to_blueprint
,
create_function
,
add_function_parameter
,
create_event_dispatcher
,
create_blueprint_interface
,
implement_interface
,
add_widget_child
11
蓝图发现
list_node_types
,
list_blueprint_classes
,
list_functions
3
蓝图节点
add_node
,
connect_nodes
,
remove_node
,
get_node_pins
,
set_pin_default
,
batch_execute
,
add_pin
,
auto_layout_graph
8
材质
create_material
,
add_material_expression
,
connect_material_expressions
,
apply_material_to_actor
,
get_available_materials
5
资源
search_assets
,
get_assets_by_class
,
get_asset_details
3
编辑器
focus_viewport
,
get_current_level_info
,
save_all
,
get_project_settings
,
set_project_setting
,
get_world_settings
,
set_world_setting
7
动画
create_anim_blueprint
,
get_anim_blueprint_info
,
add_anim_state_machine
,
add_anim_state
,
add_anim_transition
,
set_anim_state_animation
,
compile_anim_blueprint
7
通用反射
list_components
,
list_properties
,
get_component_property
,
set_component_property
,
create_asset
,
get_asset_property
,
set_asset_property
,
call_function
,
get_object
,
modify_array_property
,
execute_python
11

Error Quick Reference

错误速查

Error patternFix
"not found"
Use discovery commands (
find_actors_by_name
,
search_assets
,
list_functions
,
list_node_types
,
list_properties
)
"Pin 'xxx' not found"
Error response lists all available pins — use the correct name
compile_blueprint
diagnostics
Read references/blueprint.md error handling section
错误模式修复方法
"not found"
使用发现命令(
find_actors_by_name
,
search_assets
,
list_functions
,
list_node_types
,
list_properties
"Pin 'xxx' not found"
错误响应会列出所有可用引脚——使用正确名称
compile_blueprint
诊断信息
阅读references/blueprint.md中的错误处理章节