標籤:
1.準備工作及介紹
時間有點緊張,寫的不是很詳細,請見諒。
目前的版本是2.2以上,購買版的。試用版的無法試用Command line
Both Spine and the Spine launcher must be 2.1.00 or higher to perform command line export. To update the Spine launcher, download and reinstall Spine.
將Spine的安裝目錄設定到系統內容變數中(我的電腦,右鍵,屬性,進階系統屬性,環境變數,系統變數的path 中添加)\
配置成功之後,可以在cmd命令列中輸入Spine -h 會出現匯出協助。如下面:
Editor:-h, --help Print this help message and exit.-v, --version Print version information and exit.-l, --logout Logout, removing activation code.-k, --keys Enable hotkey popups by default.-n, --notimeout Disable timeout when checking for and downloading updates.-x, --proxy Proxy server to use when checking for and downloading updates.-s, --scale Experimental: UI scale, default is 1.0.project.spine Path to Spine project file to open.Export:-i, --input Path to Spine project file, overrides export settings JSON.-o, --output Path to write export file(s), overrides export settings JSON.-e, --export Path to export settings JSON file.Pack:-i, --input Path to folder of images to be packed.-o, --output Path to write texture atlas files.-p, --pack Texture atlas name or path to pack settings JSON file.Examples:Spine --export /path/to/export.jsonSpine --export "/path/with spaces/to/export.json"Spine --input /path/to/project.spine --output /path/to/output/ --export /path/to/export.jsonSpine -i /path/to/project.spine -o /path/to/output/ -e /path/to/export.jsonSpine -e /path/to/export1.json -e /path/to/export2.jsonSpine -i /path/to/images/ -o /path/to/output/ --pack /path/to/pack.jsonSpine -i /path/to/images/ -o /path/to/output/ -p /path/to/pack.jsonSpine -i /path/to/project1.spine -o /path/to/output/ -e /path/to/export1.json -i /path/to/project2.spine -e /path/to/export2.json -i /path/to/images/ -o /path/to/output/ -p /path/to/pack.json
-i 需要匯出的 XX.spine路徑
-o 匯出路徑
-e 設定json 註:我們可以在spine 軟體中, spine ->export中進行設定,然後點擊save,儲存一個json檔案,就是匯出時需要的檔案。我這裡起名字為spinesetting.json
-i spine路徑 -o 匯出路徑 -e setting.json路徑
在工具裡面,根據我們的需求設定完成後,然後點擊save,儲存一個json檔案,就是咱們需要的json檔案
另一種是 -i -o -p
-p Texture atlas name or path to pack settings JSON file.
2.使用bat,大量操作
下面是我寫的一個bat命令。複製出來,然後建立個test.bat,複製就可以,然後修改一下。bat命令我不太熟悉,請見諒。。。
@echo offset DIR=%~dp0echo - cleanupif exist "%DIR%SpineExport" rmdir /s /q "%DIR%SpineExport"mkdir "%DIR%SpineExport"echo -spineExportfor /f "delims=" %%i in (‘dir /b/a-d/s %DIR%SpineSource\*.spine‘) do Spine -i %%i -o "%DIR%SpineExport" -e "%DIR%spinesetting.json"echo -exportEndpause
set DIR=%~dp0 :設定DIR變數為當前絕對路徑
for /f "delims=" %%i in (‘dir /b/a-d/s %DIR%SpineSource\*.spine‘) :遍曆檔案夾下和子檔案夾下的.spine類型檔案 ,並執行匯出命令。
官網文檔 http://zh.esotericsoftware.com/spine-export
Spine大量匯出Command line Export