Build lighting from command line

Is it possible to build lighting of a map from command line?

I have the same question. Anyone have an answer?

Yep, me too :slight_smile:

Would be great to know this as well…multiple people would like to know.

i’m waiting too

i hope someone from unreal will answer this question?

what kind of support is this? i its not possible just say its not possible…

Ok. I filled a “feature request” on the forums: Build static lighting from command line - Feedback for Unreal Engine team - Unreal Engine Forums . Thanks.

Light can be rebuild from console by command like:

UE4Editor.exe "C:\Work\Game\Game.uproject" Empty -AutomatedMapBuild CLDesc="Rebuilding Empty map" UseSCC=true

Also see:

Is this possible now with that commandlet?
Where do I indicate the map that I want to rebuild?

EDITED - OK I assume that I must replace the Empty word by my map name

UE4Editor.exe “C:\Work\Game\Game.uproject” Empty -AutomatedMapBuild CLDesc=“Rebuilding SomeMapName map” UseSCC=true

Arguments:

  • -AutomatedMapBuild - Map rebuild option (Light, Navigation graph, eth)
  • Empty - Map name
  • CLDesc - Commit message

Stock 4.7 version require perforce (fixed by https://github.com/EpicGames/UnrealEngine/pull/1188 ).

But we must remember: you need video card for light calcuation.

Thanks!
Using “UseSCC=false” can it runs without interacting with the source code control system? [looked at your PR, the answer is “yes” :slight_smile: ]

  • On master - yes
  • On 4.7, 4.8 - you need merge PR 1188 before

This feature is definitely not working with the command line here. It’s launching the editor, checking out the files, checking in the files, and then closing. It never actually builds the lighting.

Can it be related to the problem reported in the forum [in function FEditorBuildUtils::EditorAutomatedBuildSubmit() the level is saved before the building of lights is completed.] ?

A new commandlet has been added to 4.10 to build lighmaps: https://github.com/EpicGames/UnrealEngine/commit/f89256dd0efb7d0b1427729a8f8a6007

Runs a lighting build for specific, or all, map(s). Reusing the ResavePackages commandlet. The commandline for the commandlet is:

ProjectName -run=resavepackages -buildlighting -allowcommandletrendering -map=optionalmapname

Script added to UAT to automate the process. The commandline for this is:

RebuildLightmaps -project=“My:/Absolute/Project/Path.uproject” -MapsToRebuildLightMaps=OptionalMapName

optionalmapname - Remember that this cannot be absolute path name, just map name ex: -map=ExampleMap OR -map=ExampleMap.umap, that is somewhere in Content directory.

Otherwise you will get an error:
“DoesPackageExist: DoesPackageExist FAILED: ‘’ is not a standard unreal filename or a long path name. Reason: Path should be no less than 4 characters long.”

Is there no way to adjust the quality settings from the command line?

I’m really interested to adjust quality settings too, or at least to know how the quality setting is chosen when building from cmd line.

It’s forced to “Production Quality”: https://github.com/EpicGames/UnrealEngine/blob/release/Engine/Source/Editor/UnrealEd/Private/Commandlets/ContentCommandlets.cpp#L919

In the linked old source code it was configurable, then Epic changed its mind I suppose.

It is possible now, add the switch -Quality=Preview/Medium/High/Production.

Here’s an example, the command I use:

"C:\Unreal\UE_4.20\Engine\Binaries\Win64\UE4Editor-Cmd.exe" "D:\Documentos\Unreal Projects\Project\Project.uproject" -run=resavepackages -buildlighting -quality=Preview -allowcommandletrendering -map=MapName

MapName should not contain folders, even if it resides inside a subfolder. Just the map name.