# Build lighting from command line

**URL:** <https://forums.unrealengine.com/t/build-lighting-from-command-line/297535>\
**Category:** Rendering\
**Tags:** swarm, Lightmass, command-line, build, unreal-engine, Lighting, question\
**Created:** [October 28, 2014, 9:16pm UTC](https://forums.unrealengine.com/t/build-lighting-from-command-line/297535 "2014-10-28T21:16:09Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kafumanto](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/kafumanto/32/1194651_2.png) [@Kafumanto](https://forums.unrealengine.com/u/Kafumanto)\
**Post date:** [October 28, 2014, 9:16pm UTC](https://forums.unrealengine.com/t/build-lighting-from-command-line/297535/1 "2014-10-28T21:16:09Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_19c40f47](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_19c40f47](https://forums.unrealengine.com/u/anonymous_user_19c40f47)\
**Post date:** [January 6, 2015, 9:23pm UTC](https://forums.unrealengine.com/t/build-lighting-from-command-line/297535/2 "2015-01-06T21:23:03Z")

</div>

I have the same question. Anyone have an answer?

---

<div class="post-metadata">

**Author:** ![LeFxGuy](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@LeFxGuy](https://forums.unrealengine.com/u/LeFxGuy)\
**Post date:** [January 12, 2015, 12:36pm UTC](https://forums.unrealengine.com/t/build-lighting-from-command-line/297535/3 "2015-01-12T12:36:42Z")

</div>

Yep, me too 🙂

---

<div class="post-metadata">

**Author:** ![THREEONEZERO](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@THREEONEZERO](https://forums.unrealengine.com/u/THREEONEZERO)\
**Post date:** [March 18, 2015, 8:02pm UTC](https://forums.unrealengine.com/t/build-lighting-from-command-line/297535/4 "2015-03-18T20:02:44Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_a114b3751](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_a114b3751](https://forums.unrealengine.com/u/anonymous_user_a114b3751)\
**Post date:** [April 3, 2015, 9:45am UTC](https://forums.unrealengine.com/t/build-lighting-from-command-line/297535/5 "2015-04-03T09:45:55Z")

</div>

i’m waiting too

---

<div class="post-metadata">

**Author:** ![petkovic](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@petkovic](https://forums.unrealengine.com/u/petkovic)\
**Post date:** [April 23, 2015, 7:27am UTC](https://forums.unrealengine.com/t/build-lighting-from-command-line/297535/6 "2015-04-23T07:27:04Z")

</div>

i hope someone from unreal will answer this question?

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

---

<div class="post-metadata">

**Author:** ![Kafumanto](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/kafumanto/32/1194651_2.png) [@Kafumanto](https://forums.unrealengine.com/u/Kafumanto)\
**Post date:** [June 16, 2015, 12:18pm UTC](https://forums.unrealengine.com/t/build-lighting-from-command-line/297535/7 "2015-06-16T12:18:40Z")

</div>

Ok. I filled a “feature request” on the forums: [Build static lighting from command line - Feedback for Unreal Engine team - Unreal Engine Forums](https://forums.unrealengine.com/showthread.php?73201-Build-static-lighting-from-command-line) . Thanks.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_f1d3559f](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_f1d3559f](https://forums.unrealengine.com/u/anonymous_user_f1d3559f)\
**Post date:** [June 16, 2015, 12:33pm UTC](https://forums.unrealengine.com/t/build-lighting-from-command-line/297535/8 "2015-06-16T12:33:09Z")

</div>

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:

- [UDK | AutomatedMapBuild](https://udn.epicgames.com/Three/AutomatedMapBuild.html)
- [https://github.com/EpicGames/UnrealEngine/pull/1188](https://github.com/EpicGames/UnrealEngine/pull/1188)

---

<div class="post-metadata">

**Author:** ![iscaru1988](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@iscaru1988](https://forums.unrealengine.com/u/iscaru1988)\
**Post date:** [June 16, 2015, 2:34pm UTC](https://forums.unrealengine.com/t/build-lighting-from-command-line/297535/9 "2015-06-16T14:34:02Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_f1d3559f](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_f1d3559f](https://forums.unrealengine.com/u/anonymous_user_f1d3559f)\
**Post date:** [June 16, 2015, 2:45pm UTC](https://forums.unrealengine.com/t/build-lighting-from-command-line/297535/10 "2015-06-16T14:45:07Z")

</div>

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](https://github.com/EpicGames/UnrealEngine/pull/1188) ).

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

---

<div class="post-metadata">

**Author:** ![Kafumanto](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/kafumanto/32/1194651_2.png) [@Kafumanto](https://forums.unrealengine.com/u/Kafumanto)\
**Post date:** [June 16, 2015, 2:57pm UTC](https://forums.unrealengine.com/t/build-lighting-from-command-line/297535/11 "2015-06-16T14:57:48Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_f1d3559f](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_f1d3559f](https://forums.unrealengine.com/u/anonymous_user_f1d3559f)\
**Post date:** [June 16, 2015, 3:01pm UTC](https://forums.unrealengine.com/t/build-lighting-from-command-line/297535/12 "2015-06-16T15:01:15Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ddbrown30](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ddbrown30](https://forums.unrealengine.com/u/ddbrown30)\
**Post date:** [December 18, 2015, 8:55pm UTC](https://forums.unrealengine.com/t/build-lighting-from-command-line/297535/13 "2015-12-18T20:55:14Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Kafumanto](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/kafumanto/32/1194651_2.png) [@Kafumanto](https://forums.unrealengine.com/u/Kafumanto)\
**Post date:** [December 19, 2015, 1:27pm UTC](https://forums.unrealengine.com/t/build-lighting-from-command-line/297535/14 "2015-12-19T13:27:11Z")

</div>

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.] ?

---

<div class="post-metadata">

**Author:** ![Kafumanto](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/kafumanto/32/1194651_2.png) [@Kafumanto](https://forums.unrealengine.com/u/Kafumanto)\
**Post date:** [May 5, 2016, 3:25pm UTC](https://forums.unrealengine.com/t/build-lighting-from-command-line/297535/15 "2016-05-05T15:25:32Z")

</div>

A new commandlet has been added to 4.10 to build lighmaps: [https://github.com/EpicGames/UnrealEngine/commit/f89256dd0efb7d0b1427729a8f8a6007](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

---

<div class="post-metadata">

**Author:** ![Ironbelly](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/ironbelly/32/990679_2.png) [@Ironbelly](https://forums.unrealengine.com/u/Ironbelly)\
**Post date:** [August 18, 2016, 10:49pm UTC](https://forums.unrealengine.com/t/build-lighting-from-command-line/297535/16 "2016-08-18T22:49:27Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![BubuElEngino](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@BubuElEngino](https://forums.unrealengine.com/u/BubuElEngino)\
**Post date:** [August 23, 2016, 11:45am UTC](https://forums.unrealengine.com/t/build-lighting-from-command-line/297535/17 "2016-08-23T11:45:20Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Kafumanto](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/kafumanto/32/1194651_2.png) [@Kafumanto](https://forums.unrealengine.com/u/Kafumanto)\
**Post date:** [August 23, 2016, 7:35pm UTC](https://forums.unrealengine.com/t/build-lighting-from-command-line/297535/18 "2016-08-23T19:35:26Z")

</div>

It’s forced to “Production Quality”: [https://github.com/EpicGames/UnrealEngine/blob/release/Engine/Source/Editor/UnrealEd/Private/Commandlets/ContentCommandlets.cpp#L919](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.

---

<div class="post-metadata">

**Author:** ![Ixiguis](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Ixiguis](https://forums.unrealengine.com/u/Ixiguis)\
**Post date:** [October 30, 2018, 9:18pm UTC](https://forums.unrealengine.com/t/build-lighting-from-command-line/297535/19 "2018-10-30T21:18:52Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![DLejeune](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@DLejeune](https://forums.unrealengine.com/u/DLejeune)\
**Post date:** [February 27, 2019, 3:34am UTC](https://forums.unrealengine.com/t/build-lighting-from-command-line/297535/20 "2019-02-27T03:34:10Z")

</div>

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.

[Next page](https://forums.unrealengine.com/t/build-lighting-from-command-line/297535.md?page=2)
