Build lighting from command line

Is there a switch to have it save the sublevels as well? When I specify a map it does the build, and from the output I can tell that it’s loaded the sub-levels for the specified map and they’re effecting the bake, but when it saves it only saves the specified map, not its sub-levels, which is not tremendously useful.

I have the same problem as DLejeune on 4.21. On this post the OP says it was working fine on 4.19, saving sublevels. But it doesn’t save them on 4.21.

HEY GUYS
PLIZ I NEED HELP ACTAULY BUILDING THE LIGHT VIA CMD
I HAVE TRIED LAUNCHING THE CMD EDITOR BUT ALL IT DOES IS LAUNC MY PROJECT AND THE ENGINE.
BEEN READING ALL THE STAFF ABOVE BUT I CANT GET IT TO WORK. PLIZ… A VIDEO WOULD BE NICE, THERES NON ON YOUTUBE.

I can confirm that this tool is non-functional. It does most things right, and transacts with SCC (source control client) but doesn’t actually build the level. The map instantly closes after the editor is opened. Also, there are pop-up windows asking to checkout the _BuildData.uasset files, since the filtering of levels is related to the level name “InitialMapName”–including file extension of .umap (or so I thought. I commented-out the file extension lines in UnrealEdMisc.cpp). This is for UES 4.25.

This tool seems officially deprecated. The documentation is for UDK and from 2012. Perhaps the top-ranked answer on this page is a newer version (the -buildlighting argument as opposed to -AutomatedMapBuild), but it doesn’t connect to SCC. This is something which is imperative. It may also only build lighting, and not paths or precomputed visibility. The whole process should be much smoother. I had a Windows Task Scheduler event setup and everything. Really wanted this to work. It should be something which is easy and built into UE, itself (or at least the front-end/automation section of UEFrontEnd). Sent Epic a bug about this (Case # 00309683).

This one seems to be the latest version of the command line argument script, but doesn’t communicate with source control. This is not useful if working on a professional project.

[2021.04.03-06.32.30:993][  0]LogInit: Display: LogContentCommandlet: Warning: Skipping read-only file C:/Unreal/MOD_Haus/Content/Armstrong/Maps/Mountain_House_P.umap

Same question… but on Linux headless server

Having same issue, but on linux. Please help

I am trying to build lighting for my map with command line, on a headless Ubuntu 20.04 server. Not having any luck…

cmd%> ./UE4Editor-Cmd -run=resavepackages -buildlighting -quality=Production -MapsOnly -AllowCommandletRendering -Map=

The warnings i receive:
[2021.10.26-00.56.11:372][ 0]LogRHI: Warning: Could not detect DISPLAY or WAYLAND_DISPLAY environment variables
[2021.10.26-00.56.11:375][ 0]LogInit: Warning: Could not initialize SDL: No available video device
[2021.10.26-00.56.11:375][ 0]LogLinux: Warning: MessageBox: Failed to load Vulkan Driver which is required to run the engine.
The engine no longer fallbacks to OpenGL4 which has been deprecated.: Message: No available video device:

UE 4.27.1 compiled from source
Linux: 5.8.0-43-generic #49~20.04.1-Ubuntu
NVIDIA-SMI 465.19.01 Driver Version: 465.19.01 CUDA Version: 11.3
Vulkan Instance Version: 1.2.131
and vulkan utils is installed.

Hi is there any way to use RebuildLightMaps without P4?

It is BUT, not via the UAT. For example on Unreal Engine 5.2, when I try to do it via RunUAT.bat like this:

 RunUAT.bat RebuildLightmaps -project="E:\unreal\coop-game-fleep\CoopGameFleep.uproject" -noP4 -platform=Win64 -clientconfig=Development

I get an error like:

Command RebuildLightMaps requires P4 functionality.
:: ERROR: System.ComponentModel.Win32Exception (2): An error occurred trying to start process 'p4.exe' with working directory 

If I use the UnrealEditor-Cmd.exe directly it seems to work and doesn’t need the Perforce dependency:

UnrealEditor-Cmd.exe "E:\unreal\coop-game-fleep\CoopGameFleep.uproject" -run=resavepackages
 -buildlighting -allowcommandletrendering -quality=Preview -map=P_TestMap