UE Web Remote Control call python script
UE 远程调用Python(UE Python API)脚本
Web Remote Control
在网页客户端远程操作虚幻引擎项目。
虚幻编辑器提供了一套强大的工具,几乎可以操纵项目内容的方方面面。但在某些情况下,要在大型内容编辑流程中成功使用引擎,需从编辑器UI以外对项目进行修改。
网页远程控制(Web Remote Control)系统实现了这一目标,它在虚幻引擎中运行一个网页服务器,服务由远程网页应用程序通过类似REST API发出的WebSocket消息和HTTP请求。

启用插件
启用(Enabled)远程控制API(Remote Control API)
![[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-X1m3j7za-1690543928326)(./images/RemoteControlAPI.png)]](https://img-blog.csdnimg.cn/601b23f0b2d046a68de70b22045ae53f.png)
开启服务
WebControl.StartServer
WebControl.StopServer
WebControl.EnableServerOnStartup
![[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-ZlY1Iegl-1690543928327)(./images/WebControlServer.png)]](https://img-blog.csdnimg.cn/631225f9b80943f285b115c2cc99694b.png)
Web Put 调用
Python
RootPath/:Project/Content/Python/remote.py
import unreal
@unreal.uclass()
class RemoteClass(unreal.BlueprintFunctionLibrary):
@unreal.ufunction(static=True)
def remote():
print("Hello from remote!")

带参数的函数

Install Python

Call
http://localhost:30010/remote/object/call
{
"objectPath":"/Engine/PythonTypes.Default__RemoteClass",
"functionName":"remote"
}
Postman 测试调用API




参考
-
https://docs.unrealengine.com/5.0/zh-CN/remote-control-quick-start-for-unreal-engine/
-
https://forums.unrealengine.com/t/executing-python-with-web-remote-control/156550
-
https://docs.unrealengine.com/5.0/zh-CN/remote-control-api-http-reference-for-unreal-engine/
-
https://blog.csdn.net/mrbaolong/article/details/131986753?spm=1001.2014.3001.5501



















