diff --git a/.gitattributes b/.gitattributes index c2a0aa3..f2bbdb4 100644 --- a/.gitattributes +++ b/.gitattributes @@ -94,6 +94,9 @@ *.prproj filter=lfs diff=lfs merge=lfs -text *.ai filter=lfs diff=lfs merge=lfs -text *.psd filter=lfs diff=lfs merge=lfs -text +*.pk filter=lfs diff=lfs merge=lfs -text +*.pkf filter=lfs diff=lfs merge=lfs -text + # Davinci Resolve files *.dpx filter=lfs diff=lfs merge=lfs -text @@ -108,6 +111,8 @@ *.pdn filter=lfs diff=lfs merge=lfs -text *.pur filter=lfs diff=lfs merge=lfs -text *.db filter=lfs diff=lfs merge=lfs -text +*.raw filter=lfs diff=lfs merge=lfs -text +*.lnk filter=lfs diff=lfs merge=lfs -text # Python files *.npz filter=lfs diff=lfs merge=lfs -text diff --git a/Renders/CompressPNGs.bat b/Renders/CompressPNGs.bat new file mode 100644 index 0000000..80aa9a2 --- /dev/null +++ b/Renders/CompressPNGs.bat @@ -0,0 +1,43 @@ +@echo off +setlocal EnableExtensions EnableDelayedExpansion + +set "REN_DIR=%~dp0" +for %%I in ("%REN_DIR%..") do set "PROJ_ROOT=%%~fI" + +set "CONFIG_DIR=%PROJ_ROOT%\.config" +set "CONFIG_PATH=%CONFIG_DIR%\config.json" +set "GET_STRUCT_DIR=%CONFIG_DIR%\GetStructDir.ps1" + +if not exist "%CONFIG_PATH%" ( + echo [ERROR] config.json not found at %CONFIG_PATH% + echo Please run ConfigLoader.ps1 to deploy helper files. + exit /b 1 +) + +if not exist "%GET_STRUCT_DIR%" ( + echo [ERROR] GetStructDir.ps1 not found at %GET_STRUCT_DIR% + echo Please run ConfigLoader.ps1 to deploy helper files. + exit /b 1 +) + +for /f "usebackq delims=" %%I in (`powershell -NoProfile -ExecutionPolicy Bypass -Command ^ + "Set-StrictMode -Version Latest; $structDir = & '%GET_STRUCT_DIR%' -ProjectRoot '%PROJ_ROOT%'; if (-not $structDir) { throw \"Failed to get structDir from GetStructDir.ps1\" }; $pyPath = Join-Path $structDir 'compress_sequence_pngs.py'; if (-not (Test-Path -LiteralPath $pyPath)) { throw \"compress_sequence_pngs.py not found at $pyPath\" }; Write-Output $pyPath"`) do set "PY_SCRIPT=%%~I" + +if not defined PY_SCRIPT ( + echo [ERROR] Unable to resolve compress_sequence_pngs.py path from config. + exit /b 1 +) + +pushd "%PROJ_ROOT%" >nul 2>&1 + +python "%PY_SCRIPT%" %* +set "ERR=!ERRORLEVEL!" + +popd >nul 2>&1 + +if !ERR! NEQ 0 ( + echo PNG compression failed ^(exit code !ERR!^). + exit /b !ERR! +) + +exit /b 0 diff --git a/Renders/UpdateSequences.bat b/Renders/UpdateSequences.bat index 260c0a6..c11c9e9 100644 --- a/Renders/UpdateSequences.bat +++ b/Renders/UpdateSequences.bat @@ -55,9 +55,16 @@ if not defined ps1 ( exit /b 1 ) -echo Running PowerShell update script... +REM Run from batch directory (sequences next to batch, or submodule root) +set "WORK_DIR=%script_dir%" +if "%WORK_DIR:~-1%"=="\" set "WORK_DIR=%WORK_DIR:~0,-1%" +pushd "%WORK_DIR%" >nul 2>&1 + +echo Running PowerShell update script in %WORK_DIR%... powershell -NoProfile -ExecutionPolicy Bypass -File "%ps1%" set "rc=%errorlevel%" + +popd >nul 2>&1 echo PowerShell exited with RC=%rc% echo Done. pause >nul