squad-proto/tools/build_assets.ps1

42 lines
1.5 KiB
PowerShell
Raw Permalink Normal View History

param(
[int]$Jobs = 4,
[switch]$RenderMissing
)
$ErrorActionPreference = 'Stop'
$env:BLENDER_BIN = 'C:\Program Files\Blender Foundation\Blender 5.2\blender.exe'
if ($RenderMissing) {
python tools/agent_assets.py blender-render-all --animations idle walk attack
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
python tools/monster_assets.py monster-render-all
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
}
python tools/agent_assets.py sync
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
python tools/monster_assets.py sync
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
python tools/generate_static_assets.py
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
python tools/agent_assets.py validate --strict
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
python tools/monster_assets.py validate --complete --strict
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
python tools/asset_coverage.py --release
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
$manifests = @(
'assets/manifests/environment.yaml',
'assets/manifests/enemies.yaml',
'assets/manifests/agents.generated.yaml',
'assets/manifests/static.generated.yaml',
'assets/manifests/monsters.generated.yaml'
)
python -m spriteforge.cli validate @manifests
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
python -m spriteforge.cli build @manifests --output build/sprites --cache-dir .sfcache --jobs $Jobs
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
python -m spriteforge.cli codegen --build-dir build/sprites --output generated/spriteforge_assets.h
exit $LASTEXITCODE