I pass in 2 variables to the BatchFile, the name of the directory the files are in and the final output name of the newly created file. The problem is that the file names are 'Bitmap 1.png, Bitmap 2.png, Bitmap 3.png ...', but they're getting read in as '1.png, 2.png, 3.png...'.
Here's the code:
Code: Select all
@echo off
:: takes in the directory of the PNG images to be texture packed
set PathName = %1
set SheetName = %2
:: sets the directory to the path of the PNG images
C:
cd %1
:: creates the variable myvar with the list of PNG images
setlocal enabledelayedexpansion
set myvar=
for /r %%i In (*.png) DO set myvar=!myvar! %%~nxi
:: runs TexturePacker commandline tool
"C:\Program Files (x86)\CodeAndWeb\TexturePacker\bin\TexturePacker.exe" --format json --data texture.json --texture-format png --dpi 72 --opt RGBA8888 --max-size 2048 --sheet %2.png %myvar%
PAUSE
Hopefully this is an easy problem to solve, as it is important for me to fix. Also I very very rarely write batch scripts, so if there's anything odd in my code id appreciate in knowing.