Files
2026-02-26 23:45:31 +08:00
..
2026-02-26 23:45:31 +08:00
2026-02-26 23:45:31 +08:00
2026-02-26 23:45:31 +08:00
2026-02-26 23:45:31 +08:00
2026-02-26 23:45:31 +08:00
2026-02-26 23:45:31 +08:00

UnrealAgentLink 工具能力(增量)

服务端请求Actor Management

  • 统一变换接口 actor.set_transform
    • 结构:targets(选择器) + operation(操作)
    • targets 字段:
      • names: 字符串数组,指定 Actor 名称。
      • paths: 字符串数组,指定 Actor 路径。
      • filter: 筛选器对象,支持 class (包含匹配), name_pattern (通配符), exclude_classes (排除类名数组)。
    • operation 字段:
      • space: "World" (默认) 或 "Local"
      • snap_to_floor: true (执行贴地)。
      • set: 绝对值设置 (location, rotation, scale)。
      • add: 增量设置 (location, rotation, scale),支持负数。
      • multiply: 倍乘设置 (location, rotation, scale)。
    • 示例 1单体绝对设置Z=200
      {
        "ver":"1.0","type":"req","id":"t1","method":"actor.set_transform",
        "params":{
          "targets": {"names": ["MyCube"]},
          "operation": {
            "set": {"location": {"z": 200}}
          }
        }
      }
      
    • 示例 2批量增量所有灯光 Z 轴上移 500局部坐标系
      {
        "ver":"1.0","type":"req","id":"t2","method":"actor.set_transform",
        "params":{
          "targets": {
            "filter": {"class": "Light"}
          },
          "operation": {
            "space": "Local",
            "add": {"location": {"z": 500}}
          }
        }
      }
      
    • 示例 3多选倍乘Cube_1 和 Sphere_2 放大 2 倍)
      {
        "ver":"1.0","type":"req","id":"t3","method":"actor.set_transform",
        "params":{
          "targets": {
            "names": ["Cube_1", "Sphere_2"]
          },
          "operation": {
            "multiply": {"scale": {"x": 2, "y": 2, "z": 2}}
          }
        }
      }
      
    • 响应code 200
      {"ver":"1.0","type":"res","id":"t1","code":200,"result":{"count":1,"actors":[{"name":"MyCube",...}]}}