Hello, I made 2 scripts about this problem.
The first runs in UGS and warns if the EditorPerProjectUserSettings.ini file exceeds a certain size:
`# Scripts/CheckProjectUserSettings.ps1
param (
[Parameter(Mandatory = $true)]
[string]$ProjectPath,
[Parameter(Mandatory = $false)]
[int]$MaxSizeKB = 1024
)
$iniPath = Join-Path $ProjectPath “Saved\Config\WindowsEditor\EditorPerProjectUserSettings.ini”
if (-not (Test-Path $iniPath))
{
Write-Host “File not found: $iniPath”
exit 0
}
$fileInfo = Get-Item $iniPath
$fileSizeKB = [math]::Round($fileInfo.Length / 1KB, 2)
if ($fileSizeKB -gt $MaxSizeKB)
{
Write-Warning “EditorPerProjectUserSettings.ini exceeds $MaxSizeKB KB! (Current: $fileSizeKB KB)”
Write-Warning “You can clean up and optimize the file by using the "Clean User Setting Ini
” tool in UGS (located in the menu More… > Clean User Setting Ini)"
}`You need to add it to UGS using the Build/UnrealGameSync.ini file (in the Build or Sync section, depending on your preferences):
+Step=(UniqueId="01965f45-1e0e-78b0-9b83-7f2974839abd", Description="Check User Settings Ini Size", StatusText="Checking User Settings Ini File Size...", EstimatedDuration="1", Type="Other", FileName="$(ComSpec)", WorkingDir="", Arguments="/C powershell -ExecutionPolicy Bypass -file $(BranchDir)\\Scripts\\CheckProjectUserSettings.ps1 -ProjectPath $(ProjectDir)", bUseLogWindow="True", bNormalSync="True", bScheduledSync="True", bShowAsTool="False")
The second script cleans up the large, uncritical categories in the Ini file.
`# Scripts/CleanProjectUserSettings.ps1
param (
[Parameter(Mandatory = $true)]
[string]$ProjectPath
)
function Remove-IniSection
{
param (
[Parameter(Mandatory = $true)]
[string]$FilePath,
[Parameter(Mandatory = $true)]
[string]$SectionNames
)
if (-not (Test-Path $FilePath))
{
Write-Host “File not found: $FilePath”
return
}
$lines = Get-Content $FilePath -Raw | Out-String
$lines = $lines -split “r?
n”
$outputLines = @()
$insideSection = $false
$currentSection = “”
foreach ($line in $lines)
{
if ($line -match ‘^[(.+)]$’)
{
$currentSection = $matches[1]
if ($SectionNames -contains $currentSection)
{
$insideSection = $true
continue
}
else
{
$insideSection = $false
}
}
if (-not $insideSection)
{
$outputLines += $line
}
}
[System.IO.File]::WriteAllLines($FilePath, $outputLines)
}
$iniPath = Join-Path $ProjectPath “Saved\Config\WindowsEditor\EditorPerProjectUserSettings.ini”
Remove-IniSection -FilePath $iniPath
-SectionNames @(
“DetailCategories”,
“DetailCustomWidgetExpansion”,
“DetailCategoriesAdvanced”,
“DetailPropertyExpansion”,
“DetailMultiObjectNodeExpansion”,
“AssetEditorToolkitTabLocation”
)`And to add it to UGS:
+Step=(UniqueId="01965f26-bfc1-7228-b7b2-2d2cfd4109b3", Description="Clean User Settings Ini", StatusText="Cleaning User Settings...", EstimatedDuration="1", Type="Other", FileName="$(ComSpec)", WorkingDir="", Arguments="/C powershell -ExecutionPolicy Bypass -file $(BranchDir)\\Scripts\\CleanProjectUserSettings.ps1 -ProjectPath $(ProjectDir)", bUseLogWindow="True", OrderIndex="170", bNormalSync="False", bScheduledSync="False", bShowAsTool="True")
This script can then be executed manually from the “More…” tool menu in the UGS project toolbar. (More… > Clean User Settings Ini)