diff --git a/GitScripts b/GitScripts index 61c2bef..eb710d8 160000 --- a/GitScripts +++ b/GitScripts @@ -1 +1 @@ -Subproject commit 61c2bef0d3190bb028914cdf4272b836f9c3a3a3 +Subproject commit eb710d85b3be4f3719d76d9ff2dc33b31a1ba43d diff --git a/ue4-rebuild-lightmaps.ps1 b/ue4-rebuild-lightmaps.ps1 index bc407ad..096d2d7 100644 --- a/ue4-rebuild-lightmaps.ps1 +++ b/ue4-rebuild-lightmaps.ps1 @@ -19,6 +19,9 @@ param ( . $PSScriptRoot\inc\ueinstall.ps1 . $PSScriptRoot\inc\filetools.ps1 +# Include Git tools locking +. $PSScriptRoot\GitScripts\inc\locking.ps1 + function Write-Usage { Write-Output "Steve's UE4 lightmap rebuilding tool" Write-Output "Usage:" @@ -75,8 +78,6 @@ try { throw "No maps found to rebuild" } - # TODO lock map files if read-only - if (-not $quality) { $quality = "Production" } @@ -93,6 +94,18 @@ try { Write-Output "Quality : $quality" Write-Output "" + # lock map files if read-only + if ($isGit -and -not $dryrun) { + if ($src -ne ".") { Push-Location $src } + + foreach ($mapfullname in $foundmaps.FullNames) { + $relativepath = Resolve-Path $mapfullname -Relative + Lock-If-Required $relativepath + Lock-If-Required $($relativepath -replace ".uasset","_BuiltData.uasset") + } + if ($src -ne ".") { Pop-Location } + } + $argList = [System.Collections.ArrayList]@() $argList.Add("`"$projfile`"") > $null $argList.Add("-run=ResavePackages") > $null @@ -112,8 +125,9 @@ try { Write-Output "Would have run:" Write-Output "> $ueEditorCmd $($argList -join " ")" - } else { - $proc = Start-Process $runUAT $ueEditorCmd -Wait -PassThru -NoNewWindow + } else { + Write-Output "Starting lighting build; see Swarm Agent for full progress monitoring..." + $proc = Start-Process $ueEditorCmd $argList -Wait -PassThru -NoNewWindow if ($proc.ExitCode -ne 0) { throw "Lightmap build failed!" } @@ -129,3 +143,4 @@ try { Write-Output "~-~-~ UE4 Lightmap Rebuild OK ~-~-~" +Write-Output "Reminder: You may need to commit and unlock map files"