RebuildLightmaps requires P4

Hi,

I’m trying to build lighting from the command line:

./RunUAT.bat RebuildLightmaps -project=path/to/my/project/foo.uproject

and I get:

WARNING: Command RebuildLightmaps requires P4 functionality.
Setting up Perforce environment.
WARNING: P4PORT is not set. Trying to fallback to perforce:1666
TCP connect to perforce:1666 failed.
Please make sure your P4PORT or uebp_PORT is set properly.

but when I run a p4 set from the command line, I can clearly see all my p4 config vars.
I also configured the project to use p4, in case UE4 is somehow pulls settings from there, but no luck.

?

1 Like

Same here, any news?

Manage to get it work but now I get this error :

RebuildLightMaps.ExecuteBuild: ********** REBUILD LIGHT MAPS COMMAND FAILED **********
RebuildLightMaps.ExecuteBuild: Error message: Couldn’t enumerate latest change from branch

P4Connection.Changes: WARNING: Exception was Exception in AutomationUtils.Automation: Change 1234 on 2016/09/07 by john@john_pc12 ‘Fixing some informat not bei’

Stacktrace: at AutomationTool.P4Connection.Changes(List`1& ChangeRecords, String CommandLine, Boolean AllowSpew, Boolean UseCaching, Boolean LongComment, Boolean
Client) in D:\MyProject\UE4\Engine\Source\Programs\AutomationTool\AutomationUtils\P4Utils.cs:line 794

The CL comment is incomplete.

my P4 Set : I replaced confidential info by X or Y

P4CLIENT=stixier_pc-XXXXXXXXXX (set)
P4EDITOR=C:\Program Files (x86)\Notepad++\notepad++.exe (set)
P4IGNORE=.p4ignore.txt (set)
P4PORT=pc-XXXXXXXXXX:2666 (set)
P4USER=stixier (set)
P4_pc-YYYYYYY:2666_CHARSET=none (set)

Is the CHARSET thingy causing the error ?

We got it working by commenting out all of the P4 deps in the Automation Tool source. However, that was a hack I wasn’t willing to live with, as I’d have to migrate those changes with each version upgrade. It seems pretty silly to have a P4 dependency in there to begin with, imho. In the end, we decided to have 1 person build lightmaps and be the swarm coordinator.

Oh, Okay.
Thanks for replying.

Hi all,

You may want to try using the ResavePackages commandlet since this is the one now used internally for Epic projects that have to have their lighting built via command line.

You can find more information here: A new, community-hosted Unreal Engine Wiki - Announcements - Epic Developer Community Forums

I’ve not used the RebuildLightmaps commands, but I’m fairly certain this one had some issues before it was abandoned for this latest addition.

I hope this helps.

Tim

Unfortunately ResavePackages still requires P4. The option -nop4 does not seem to work with it. Are there any ways to build lighting from the command line without having Perforce installed, short of hacking the source?

1 Like

Any update on this?

As of Unreal 5.2.1 / July 2023 - both ResavePackages and RebuildLightmaps still have the Perforce dependancy and will fail:

Command RebuildLightMaps requires P4 functionality.
Command ResavePackages requires P4 functionality.

This is regardless of using the -noP4 argument or not.