Files
ChildHood/tools/level-builder/config/asset_mapping.py
T
starmen1265 0f96b79dba feat(tools): 白模关卡自动生成Python脚本——Level Builder
两阶段流水线:搭建指南Markdown → JSON → UE5 Actor
- 解析器:4种表格变体+范围展开+坐标表达式计算
- 配置:37种BSP资产映射+13种材质+7区域定义
- 验证:265个Actor全部通过,0错误
- Builder:UE5 Python API自动放置Actor+材质+Outliner
- 报告:自动生成搭建报告Markdown

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-07 23:03:45 +08:00

212 lines
7.2 KiB
Python

"""BSP 资产设计名 → UE5 内容路径映射。
数据来源: docs/technical/关卡-v01-搭建指南.md 第一章 (BSP 资产映射表)
资产根路径: Content/BlockingStarterPack/Meshes/
路径格式: /Game/<ContentSubPath>/<AssetName>.<AssetName>
"""
# 资产路径前缀
MESH_ROOT = "/Game/BlockingStarterPack/Meshes"
MATERIAL_ROOT = "/Game/BlockingStarterPack/Materials"
MESH_ASSETS = {
# ---- 建筑 — 墙体 ----
"Wall_400x300": {
"path": f"{MESH_ROOT}/Architecture/Walls/SM_Wall_400x300.SM_Wall_400x300",
"default_size": (400, 20, 300),
"category": "wall",
},
"Wall_200x300": {
"path": f"{MESH_ROOT}/Architecture/Walls/SM_Wall_200x300.SM_Wall_200x300",
"default_size": (200, 20, 300),
"category": "wall",
},
"Wall_100x300": {
"path": f"{MESH_ROOT}/Architecture/Walls/SM_Wall_100x300.SM_Wall_100x300",
"default_size": (100, 20, 300),
"category": "wall",
},
"Wall_400x100": {
"path": f"{MESH_ROOT}/Architecture/Walls/SM_Wall_400x100.SM_Wall_400x100",
"default_size": (400, 20, 100),
"category": "wall",
},
"WallDoor_200x300": {
"path": f"{MESH_ROOT}/Architecture/Walls/SM_WallDoor_200x300.SM_WallDoor_200x300",
"default_size": (200, 20, 300),
"category": "wall_door",
},
"WallDoorGarage_400x300": {
"path": f"{MESH_ROOT}/Architecture/Walls/SM_WallDoorGarage_400x300.SM_WallDoorGarage_400x300",
"default_size": (400, 20, 300),
"category": "wall_door",
},
"WallWindow_400x300": {
"path": f"{MESH_ROOT}/Architecture/Walls/SM_WallWindow_400x300.SM_WallWindow_400x300",
"default_size": (400, 20, 300),
"category": "wall_window",
},
"WallWindowSmall_200x300": {
"path": f"{MESH_ROOT}/Architecture/Walls/SM_WallWindowSmall_200x300.SM_WallWindowSmall_200x300",
"default_size": (200, 20, 300),
"category": "wall_window",
},
# ---- 建筑 — 地板 ----
"Floor_1000x1000": {
"path": f"{MESH_ROOT}/Architecture/Floors/SM_Floor_1000x1000.SM_Floor_1000x1000",
"default_size": (1000, 1000, 10),
"category": "floor",
},
"Floor_300x400": {
"path": f"{MESH_ROOT}/Architecture/Floors/SM_Floor_300x400.SM_Floor_300x400",
"default_size": (300, 400, 10),
"category": "floor",
},
"Floor_200x300": {
"path": f"{MESH_ROOT}/Architecture/Floors/SM_Floor_200x300.SM_Floor_200x300",
"default_size": (200, 300, 10),
"category": "floor",
},
# ---- 建筑 — 门 ----
"RotativeDoor_01": {
"path": f"{MESH_ROOT}/Architecture/Doors/SM_RotativeDoor_01.SM_RotativeDoor_01",
"default_size": None,
"category": "door",
},
"GarageDoorOpen_01": {
"path": f"{MESH_ROOT}/Architecture/Doors/SM_GarageDoorOpen_01.SM_GarageDoorOpen_01",
"default_size": None,
"category": "door",
},
# ---- 建筑 — 窗户 ----
"FakeWindowsFrame": {
"path": f"{MESH_ROOT}/Architecture/WindowsSet/SM_FakeWindowsFrame.SM_FakeWindowsFrame",
"default_size": None,
"category": "window",
},
# ---- 建筑 — 围栏/围挡 ----
"BarrierWall_600": {
"path": f"{MESH_ROOT}/Architecture/Barriers/SM_BarrierWall_600.SM_BarrierWall_600",
"default_size": (600, 20, 100),
"category": "barrier",
},
"BarrierWall_200": {
"path": f"{MESH_ROOT}/Architecture/Barriers/SM_BarrierWall_200.SM_BarrierWall_200",
"default_size": (200, 20, 100),
"category": "barrier",
},
"Fence_Small_400": {
"path": f"{MESH_ROOT}/Industrials/SM_Fence_Small_400.SM_Fence_Small_400",
"default_size": (400, 5, 100),
"category": "fence",
},
# ---- 建筑 — 横梁 ----
"Beam_300": {
"path": f"{MESH_ROOT}/Architecture/Beams/SM_Beam_300.SM_Beam_300",
"default_size": None,
"category": "beam",
},
# ---- 建筑 — 大型建筑 ----
"Building_01": {
"path": f"{MESH_ROOT}/BigBuildings/SM_Building_01.SM_Building_01",
"default_size": None,
"category": "building",
},
# ---- 家具 ----
"SimpleTable_01": {
"path": f"{MESH_ROOT}/Furnitures/SM_SimpleTable_01.SM_SimpleTable_01",
"default_size": None,
"category": "furniture",
},
"SimpleTable_02": {
"path": f"{MESH_ROOT}/Furnitures/SM_SimpleTable_02.SM_SimpleTable_02",
"default_size": None,
"category": "furniture",
},
"BedSingle": {
"path": f"{MESH_ROOT}/Bedroom/SM_BedSingle.SM_BedSingle",
"default_size": None,
"category": "furniture",
},
"Monitor_01": {
"path": f"{MESH_ROOT}/Furnitures/SM_Monitor_01.SM_Monitor_01",
"default_size": None,
"category": "furniture",
},
# ---- 工业/装饰 ----
"Barrel": {
"path": f"{MESH_ROOT}/Industrials/SM_Barrel.SM_Barrel",
"default_size": None,
"category": "industrial",
},
"WoodenBox_Small": {
"path": f"{MESH_ROOT}/Industrials/SM_WoodenBox_Small.SM_WoodenBox_Small",
"default_size": None,
"category": "industrial",
},
"WoodenBox_Normal": {
"path": f"{MESH_ROOT}/Industrials/SM_WoodenBox_Normal.SM_WoodenBox_Normal",
"default_size": None,
"category": "industrial",
},
"WoodenPallet_01": {
"path": f"{MESH_ROOT}/Industrials/SM_WoodenPallet_01.SM_WoodenPallet_01",
"default_size": None,
"category": "industrial",
},
"Bucket_01": {
"path": f"{MESH_ROOT}/Decorations/SM_Bucket_01.SM_Bucket_01",
"default_size": None,
"category": "industrial",
},
"TrashCans_01": {
"path": f"{MESH_ROOT}/Trashs/SM_TrashCans_01.SM_TrashCans_01",
"default_size": None,
"category": "industrial",
},
"Container_Normal": {
"path": f"{MESH_ROOT}/Industrials/SM_Container_Normal.SM_Container_Normal",
"default_size": None,
"category": "industrial",
},
# ---- 载具 ----
"Car01": {
"path": f"{MESH_ROOT}/Vehicles/SM_Car01.SM_Car01",
"default_size": None,
"category": "vehicle",
},
# ---- 基础体 ----
"Cube": {
"path": f"{MESH_ROOT}/Primitives/SM_Cube.SM_Cube",
"default_size": (100, 100, 100),
"category": "primitive",
},
"Cylinder": {
"path": f"{MESH_ROOT}/Primitives/SM_Cylinder.SM_Cylinder",
"default_size": (100, 100, 100),
"category": "primitive",
},
"CirclePlatform": {
"path": f"{MESH_ROOT}/Extra/SM_CirclePlatform.SM_CirclePlatform",
"default_size": None,
"category": "primitive",
},
# ---- 其他 ----
"Tree_01": {
"path": f"{MESH_ROOT}/Vegetations/SM_Tree_01.SM_Tree_01",
"default_size": None,
"category": "vegetation",
},
"RoadLamp_01": {
"path": f"{MESH_ROOT}/Lights/SM_RoadLamp_01.SM_RoadLamp_01",
"default_size": None,
"category": "light_fixture",
},
"DisplayPanels_400x200": {
"path": f"{MESH_ROOT}/DisplayPanels/SM_DisplayPanels_400x200.SM_DisplayPanels_400x200",
"default_size": None,
"category": "decoration",
},
}