mirror of
https://github.com/sinbad/UEScripts.git
synced 2025-02-23 13:15:23 +00:00
Change fileset tools to read base names and full names
This commit is contained in:
parent
23aa985658
commit
9b189a4d3e
@ -1,4 +1,4 @@
|
|||||||
function Find-File-Set {
|
function Find-Files {
|
||||||
param (
|
param (
|
||||||
[string]$startDir,
|
[string]$startDir,
|
||||||
[string]$pattern,
|
[string]$pattern,
|
||||||
@ -7,19 +7,25 @@ function Find-File-Set {
|
|||||||
[array]$excludeBaseNames
|
[array]$excludeBaseNames
|
||||||
)
|
)
|
||||||
|
|
||||||
$set = [System.Collections.Generic.HashSet[string]]::New()
|
$basenames = [System.Collections.ArrayList]::New()
|
||||||
|
$fullpaths = [System.Collections.ArrayList]::New()
|
||||||
Get-ChildItem -Path $startDir -Filter $pattern -Recurse | ForEach-Object {
|
Get-ChildItem -Path $startDir -Filter $pattern -Recurse | ForEach-Object {
|
||||||
if ($includeByDefault) {
|
if ($includeByDefault) {
|
||||||
if ($excludeBaseNames -notcontains $_.BaseName) {
|
if ($excludeBaseNames -notcontains $_.BaseName) {
|
||||||
$set.Add($_.BaseName) > $null
|
$basenames.Add($_.BaseName) > $null
|
||||||
|
$fullpaths.Add($_.FullName) > $null
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if ($includeBaseNames -contains $_.BaseName) {
|
if ($includeBaseNames -contains $_.BaseName) {
|
||||||
$set.Add($_.BaseName) > $null
|
$basenames.Add($_.BaseName) > $null
|
||||||
|
$fullpaths.Add($_.FullName) > $null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $set
|
return [PSCustomObject]@{
|
||||||
|
BaseNames = $basenames
|
||||||
|
FullNames = $fullpaths
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -132,7 +132,9 @@ try {
|
|||||||
Write-Warning "Unknown variant(s) ignored: $($unmatchedVariants -join ", ")"
|
Write-Warning "Unknown variant(s) ignored: $($unmatchedVariants -join ", ")"
|
||||||
}
|
}
|
||||||
|
|
||||||
$maps = Find-File-Set -startDir:$(Join-Path $src "Content") -pattern:*.umap -includeByDefault:$config.CookAllMaps -includeBaseNames:$config.MapsIncluded -excludeBaseNames:$config.MapsExcluded
|
$foundmaps = Find-Files -startDir:$(Join-Path $src "Content") -pattern:*.umap -includeByDefault:$config.CookAllMaps -includeBaseNames:$config.MapsIncluded -excludeBaseNames:$config.MapsExcluded
|
||||||
|
|
||||||
|
$maps = $foundmaps.BaseNames
|
||||||
|
|
||||||
Write-Output ""
|
Write-Output ""
|
||||||
Write-Output "Project File : $projfile"
|
Write-Output "Project File : $projfile"
|
||||||
|
@ -17,6 +17,7 @@ param (
|
|||||||
. $PSScriptRoot\inc\projectversion.ps1
|
. $PSScriptRoot\inc\projectversion.ps1
|
||||||
. $PSScriptRoot\inc\uproject.ps1
|
. $PSScriptRoot\inc\uproject.ps1
|
||||||
. $PSScriptRoot\inc\ueinstall.ps1
|
. $PSScriptRoot\inc\ueinstall.ps1
|
||||||
|
. $PSScriptRoot\inc\filetools.ps1
|
||||||
|
|
||||||
function Write-Usage {
|
function Write-Usage {
|
||||||
Write-Output "Steve's UE4 lightmap rebuilding tool"
|
Write-Output "Steve's UE4 lightmap rebuilding tool"
|
||||||
@ -60,17 +61,17 @@ try {
|
|||||||
|
|
||||||
if ($maps) {
|
if ($maps) {
|
||||||
# Explicit list of maps provided on command line
|
# Explicit list of maps provided on command line
|
||||||
$mapsToRebuild = Find-File-Set -startDir:$(Join-Path $src "Content") -pattern:*.umap -includeByDefault:$false -includeBaseNames:$maps
|
$foundmaps = Find-File-Set -startDir:$(Join-Path $src "Content") -pattern:*.umap -includeByDefault:$false -includeBaseNames:$maps
|
||||||
|
|
||||||
if ($mapsToRebuild.Count -ne $maps.Count) {
|
if ($mapsToRebuild.Count -ne $maps.Count) {
|
||||||
Write-Warning "Ignoring missing map(s): $($maps | Where-Object { $_ -notin $mapsToRebuild })"
|
Write-Warning "Ignoring missing map(s): $($maps | Where-Object { $_ -notin $mapsToRebuild })"
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
# Derive maps from cook settings
|
# Derive maps from cook settings
|
||||||
$mapsToRebuild = Find-File-Set -startDir:$(Join-Path $src "Content") -pattern:*.umap -includeByDefault:$config.CookAllMaps -includeBaseNames:$config.MapsIncluded -excludeBaseNames:$config.MapsExcluded
|
$foundmaps = Find-Files -startDir:$(Join-Path $src "Content") -pattern:*.umap -includeByDefault:$config.CookAllMaps -includeBaseNames:$config.MapsIncluded -excludeBaseNames:$config.MapsExcluded
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($mapsToRebuild.Count -eq 0) {
|
if ($foundmaps.BaseNames.Count -eq 0) {
|
||||||
throw "No maps found to rebuild"
|
throw "No maps found to rebuild"
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -88,7 +89,7 @@ try {
|
|||||||
Write-Output "UE Version : $ueVersion"
|
Write-Output "UE Version : $ueVersion"
|
||||||
Write-Output "UE Install : $ueinstall"
|
Write-Output "UE Install : $ueinstall"
|
||||||
Write-Output ""
|
Write-Output ""
|
||||||
Write-Output "Maps : $mapsToRebuild"
|
Write-Output "Maps : $($foundmaps.BaseNames)"
|
||||||
Write-Output "Quality : $quality"
|
Write-Output "Quality : $quality"
|
||||||
Write-Output ""
|
Write-Output ""
|
||||||
|
|
||||||
@ -103,7 +104,7 @@ try {
|
|||||||
$argList.Add("-AllowCommandletRendering") > $null
|
$argList.Add("-AllowCommandletRendering") > $null
|
||||||
$argList.Add("-SkipSkinVerify") > $null
|
$argList.Add("-SkipSkinVerify") > $null
|
||||||
$argList.Add("-Quality=$quality") > $null
|
$argList.Add("-Quality=$quality") > $null
|
||||||
$argList.Add("-Map=$($mapsToRebuild -join "+")") > $null
|
$argList.Add("-Map=$($foundmaps.BaseNames -join "+")") > $null
|
||||||
|
|
||||||
$ueEditorCmd = Join-Path $ueinstall "Engine/Binaries/Win64/UE4Editor-Cmd$exeSuffix"
|
$ueEditorCmd = Join-Path $ueinstall "Engine/Binaries/Win64/UE4Editor-Cmd$exeSuffix"
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user