Spine批量导出Command line Export
1.準(zhǔn)備工作及介紹
時(shí)間有點(diǎn)緊張,寫的不是很詳細(xì),請(qǐng)見(jiàn)諒。
當(dāng)前版本是2.2以上,購(gòu)買版的。試用版的無(wú)法試用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的安裝目錄設(shè)置到系統(tǒng)環(huán)境變量中(我的電腦,右鍵,屬性,高級(jí)系統(tǒng)屬性,環(huán)境變量,系統(tǒng)變量的path 中添加)
配置成功之后,可以在cmd命令行中輸入Spine -h 會(huì)出現(xiàn)導(dǎo)出幫助。如下面:
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.json
Spine --export "/path/with spaces/to/export.json"
Spine --input /path/to/project.spine --output /path/to/output/
--export /path/to/export.json
Spine -i /path/to/project.spine -o /path/to/output/ -e /path/to/export.json
Spine -e /path/to/export1.json -e /path/to/export2.json
Spine -i /path/to/images/ -o /path/to/output/ --pack /path/to/pack.json
Spine -i /path/to/images/ -o /path/to/output/ -p /path/to/pack.json
Spine -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 需要導(dǎo)出的 XX.spine路徑
-o 導(dǎo)出路徑
-e 設(shè)置json 注:我們可以在spine 軟件中, spine ->export中進(jìn)行設(shè)置,然后點(diǎn)擊save,保存一個(gè)json文件,就是導(dǎo)出時(shí)需要的文件。我這里起名字為spinesetting.json
-i spine路徑 -o 導(dǎo)出路徑 -e setting.json路徑
在工具里面,根據(jù)我們的需求設(shè)置完成后,然后點(diǎn)擊save,保存一個(gè)json文件,就是咱們需要的json文件
另一種是 -i -o -p
-p Texture atlas name or path to pack settings JSON file.
2.使用bat,批量操作
下面是我寫的一個(gè)bat命令。復(fù)制出來(lái),然后新建個(gè)test.bat,復(fù)制就可以,然后修改一下。bat命令我不太熟悉,請(qǐng)見(jiàn)諒。。。
@echo off
set DIR=%~dp0
echo - cleanup
if exist "%DIR%SpineExport" rmdir /s /q "%DIR%SpineExport"
mkdir "%DIR%SpineExport"
echo -spineExport
for /f "delims=" %%i in ('dir /b/a-d/s %DIR%SpineSource*.spine') do Spine -i %%i -o "%DIR%SpineExport" -e "%DIR%spinesetting.json"
echo -exportEnd
pause
set DIR=%~dp0 :設(shè)置DIR變量為當(dāng)前絕對(duì)路徑
for /f "delims=" %%i in ('dir /b/a-d/s %DIR%SpineSource*.spine') :遍歷文件夾下和子文件夾下的.spine類型文件 ,并執(zhí)行導(dǎo)出命令。
官網(wǎng)文檔 http://zh.esotericsoftware.com/spine-export
總結(jié)
以上是生活随笔為你收集整理的Spine批量导出Command line Export的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: Spring 自动装配模式之构造函数装配
- 下一篇: flash如何制作扇子张开收合的动画效果