当前位置:   article > 正文

UE5 Python执行swarm lightmass构建_ue5添加lightmas

ue5添加lightmas
#config
ProRoot='D:/UEProject'
EnginRoot='D:/Epic Games/UE_5.0EA'
ProName='test_build.uproject'
UnrealEditorCMD='UnrealEditor-Cmd.exe'
UE5Win64Path=EnginRoot+'/Engine/Binaries/Win64'
UE5BatchFiles=EnginRoot+'/Engine/Build/BatchFiles'
ProjectPath=ProRoot+'/'+ProName


#先构建个小场景 清理一下,测试后发先不这么做无法正常执行构建(可能我电脑问题吧...)
unreal.EditorLevelLibrary.load_level('/Game/Template/BuildLevel')
swarm=UnrealEditorCMD+' "'+ProjectPath+'" -run=resavepackages -buildlighting -quality=Preview -allowcommandletrendering -map=BuildLevel'
unreal.EditorAssetLibrary.save_directory('/Game')
unreal.EditorLevelLibrary.save_current_level()


os.chdir(UE5Win64Path)
os.system(swarm)  

#需要构建的关卡
level_path='/Game/Level/SomeLevel
unreal.EditorLevelLibrary.load_level(level_path)

# -Quality=Preview/Medium/High/Production
swarm=UnrealEditorCMD+' "'+ProjectPath+'" -run=resavepackages -buildlighting -quality=Preview -allowcommandletrendering -map=SomeLevel'
unreal.EditorAssetLibrary.save_directory('/Game')
unreal.EditorLevelLibrary.save_current_level()

os.chdir(UE5Win64Path)
os.system(swarm) 
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
声明:本文内容由网友自发贡献,转载请注明出处:【wpsshop博客】
推荐阅读
相关标签
  

闽ICP备14008679号