Created
April 27, 2019 09:50
-
-
Save Shilo/de5462a11212d32b3d0d3174318e5d88 to your computer and use it in GitHub Desktop.
Batch script to automatically save Aseprite file into layer images for easy import into external animation applications such as Spine and Spriter Pro. (Batch script has to be in same directory and same filename as Aseprite file)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
@set ASEPRITE="C:\Program Files (x86)\Steam\steamapps\common\Aseprite\Aseprite.exe" | |
@set FILENAME="%~n0" | |
if exist %FILENAME% ( | |
choice /c YN /m "Would you like to delete and recreate '%FILENAME%' directory " | |
if errorlevel == 2 goto save | |
if errorlevel == 1 goto delete | |
goto end | |
) | |
:save | |
echo Saving %FILENAME%.ase as %FILENAME%/{tag}.png... | |
%ASEPRITE% -b %FILENAME%.ase --trim --save-as %FILENAME%{tagframe0}/{tag}.png | |
echo Saving %FILENAME%.ase as %FILENAME%/{tag}/{layer}.png... | |
%ASEPRITE% -b %FILENAME%.ase --trim --save-as %FILENAME%{tagframe0}/{tag}/{layer}.png | |
ren %FILENAME%0 %FILENAME% | |
echo Finished saving images in %FILENAME% directory. | |
goto end | |
:delete | |
echo Deleting %FILENAME% directory... | |
rd %FILENAME% /s /q | |
goto save | |
:end | |
pause |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment