fix(level-builder): 锚点补偿+旋转修复+天空盒+解析器去重
- asset_mapping: 38种BSP资产实测锚点+pivot_offset_xy自动补偿 - scene_builder: Rotator改关键字参数修正旋转轴映射 - scene_builder: spawn前XY锚点补偿(支持Yaw旋转) - scene_builder: 新增ExponentialHeightFog+大气效果后处理 - build_cmdline: 构建后自动添加雾+GameMode+DirectionalLight大气 - build_guide_parser: 去重+全局地面+旋转列名兼容+边界段范围修正 - BarrierWall实际尺寸修正(60×210非20×100) - 搭建指南: 全局地面中心坐标+西边界旋转统一+院门改双开门
This commit is contained in:
@@ -145,11 +145,35 @@ if not json_path.exists():
|
||||
|
||||
|
||||
# ---- 导入并执行构建 ----
|
||||
from builder.scene_builder import build_level
|
||||
from builder.scene_builder import build_level, setup_post_build
|
||||
|
||||
print(f"[LevelBuilder] 开始构建...")
|
||||
build_log = build_level(str(json_path), clear_existing=True)
|
||||
|
||||
# ---- 后处理:GameMode + 大气 + ExponentialHeightFog ----
|
||||
print("[LevelBuilder] 执行关卡后处理...")
|
||||
try:
|
||||
# 添加 ExponentialHeightFog(如果场景中不存在)
|
||||
all_actors = unreal.EditorLevelLibrary.get_all_level_actors()
|
||||
has_fog = any("ExponentialHeightFog" in a.get_class().get_name() for a in all_actors)
|
||||
if not has_fog:
|
||||
editor_subsystem = unreal.get_editor_subsystem(unreal.EditorActorSubsystem)
|
||||
fog_actor = editor_subsystem.spawn_actor_from_class(
|
||||
unreal.ExponentialHeightFog,
|
||||
unreal.Vector(0, 0, 0)
|
||||
)
|
||||
if fog_actor:
|
||||
fog_actor.set_actor_label("LVL_Global_ExpHeightFog")
|
||||
fog_actor.set_folder_path("LVL_SuburbanV01/Global/Lighting")
|
||||
fog_comp = fog_actor.get_component_by_class(unreal.ExponentialHeightFogComponent)
|
||||
if fog_comp:
|
||||
fog_comp.set_editor_property("fog_density", 0.015)
|
||||
print("[LevelBuilder] ✅ ExponentialHeightFog 已添加")
|
||||
except Exception as e:
|
||||
print(f"[LevelBuilder] ⚠️ ExponentialHeightFog 添加失败: {e}")
|
||||
|
||||
setup_post_build()
|
||||
|
||||
|
||||
# ---- 保存关卡 ----
|
||||
print("[LevelBuilder] 保存关卡...")
|
||||
|
||||
Reference in New Issue
Block a user