Running PCG Builder in unattended mode trying to save files to the disk

Hey guys, I’m trying to integrate our PCG pipeline into an automatic build that would be run on our horde server. The goal is to run specific graphs at the level and save their output. The graphs specified contain a slightly modified version of SavePCGDataAsset that automatically saves the data assets without prompting the user dialog. At the end, all of the data should be submitted to the perforce.

The approach I have taken so far has been to utilize the [**Builder [Content removed] in UE 5.5.

Here is the censored version of the command I’ve been using:

UnrealEditor.exe “C:/myproject.uproject” -BaseDir=“C:/myproject/Engine/Binaries/Win64/” -Unattended -RunningFromUnrealEd -AbsLog=“C:/pcg_buildlog.log” /Game/Maps/LV_PCGBuild -run=WorldPartitionBuilderCommandlet -Builder=PCGWorldPartitionBuilder -AllowCommandletRendering -AllowSoftwareRendering -AssetGatherAll=true -PCGBuilderSettings=/Game/PCGS_Generate.PCGS_Generate

It’s essentially the command that is used when I run the PCG builder through the editor. The only modification that I’ve made was a change to the log path.

The thing I’ve noticed is that I was unable to add or save new assets generated by the SavePCGDataAsset. After some digging around, I saw that inside Editor\UnrealEd\Private\FileHelpers.cpp in the function FEditorFileUtils::PromptForCheckoutAndSave, the variable GIsRunningUnattendedScript is set to False.

Is it by design that the PCGBuilder command in unattended mode does not set the GIsRunningUnattendedScript to True?

[Image Removed]

Adjusting the code to switch the variable GIsRunningUnattendedScript to True during the PCG build solved my issues. But is it a good idea to do this this way?

Hey Adam,

I’ll redirect the question to Patrick, but that sounds like a mistake on our end more than a deliberate choice.

Cheers,

Julien

Hey Adam, like Julien mentioned I think it is just something we haven’t encountered in our own internal projects.

Made a note to fix this but in the meantime did you try adding this switch to your commandline args? -RUNNINGUNATTENDEDSCRIPT

Cheers,

Patrick

Hey Patrik, I’ve just tested it and it seems to be working fine with the additional -RUNNINGUNATTENDEDSCRIPT argument.

Thanks for the suggestion.

Have a good one,

Adam