UE Web Remote Control call python script

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)]

开启服务

WebControl.StartServer
WebControl.StopServer
WebControl.EnableServerOnStartup

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-ZlY1Iegl-1690543928327)(./images/WebControlServer.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

 1

Call

http://localhost:30010/remote/object/call


{
    "objectPath":"/Engine/PythonTypes.Default__RemoteClass",
    "functionName":"remote"
}

Postman 测试调用API

1

2

3

4

相关插件

在这里插入图片描述

参考

  1. https://docs.unrealengine.com/5.0/zh-CN/remote-control-quick-start-for-unreal-engine/

  2. https://forums.unrealengine.com/t/executing-python-with-web-remote-control/156550

  3. https://docs.unrealengine.com/5.0/zh-CN/remote-control-api-http-reference-for-unreal-engine/

  4. https://blog.csdn.net/mrbaolong/article/details/131986753?spm=1001.2014.3001.5501

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值