diff --git a/_convert.bat b/_convert.bat index af3aaa2..5b78b79 100644 --- a/_convert.bat +++ b/_convert.bat @@ -32,7 +32,10 @@ curl -L -o "%~dp0Blender.msi" https://mirrors.aliyun.com/blender/release/Blender Blender.msi goto first ) -set blender="%blender%\blender.exe" +set blender='%blender%' + +for /f "usebackq delims=" %%A in (`powershell -command "Join-Path %blender% blender.exe"`) do set blender=%%A +set blender="%blender%" :cycle set VRM=%1 diff --git a/_convert_manual.bat b/_convert_manual.bat index 104e030..0c88a2e 100644 --- a/_convert_manual.bat +++ b/_convert_manual.bat @@ -22,6 +22,7 @@ echo ===Enviroment Checker. if alert to send from Dev, send it!=== timeout 3 + echo "VRMアドオンの最新版を取得中…" curl -L -o "%~dp0VRM_Addon_for_Blender-release.zip" https://github.com/saturday06/VRM_Addon_for_Blender/raw/release-archive/VRM_Addon_for_Blender-release.zip @@ -31,8 +32,10 @@ curl -L -o "%~dp0Blender.msi" https://mirrors.aliyun.com/blender/release/Blender Blender.msi goto first ) -set blender="%blender%blender.exe" +set blender='%blender%' +for /f "usebackq delims=" %%A in (`powershell -command "Join-Path %blender% blender.exe"`) do set blender=%%A +set blender="%blender%" set VRM=%1 set OUTPUT="%~1-converted.glb" diff --git a/_license-check.bat b/_license-check.bat index 51d2223..a1e0283 100644 --- a/_license-check.bat +++ b/_license-check.bat @@ -1,20 +1,35 @@ @echo off chcp 65001 setlocal +:first -if exist "C:\Program Files\Blender Foundation\Blender 2.83\blender.exe" set BLENDER="C:\Program Files\Blender Foundation\Blender 2.83\blender.exe" -if exist "C:\Program Files\Blender Foundation\Blender 2.93\blender.exe" set BLENDER="C:\Program Files\Blender Foundation\Blender 2.93\blender.exe" -if exist "C:\Program Files\Blender Foundation\Blender 3.0\blender.exe" set BLENDER="C:\Program Files\Blender Foundation\Blender 3.0\blender.exe" -if exist "C:\Program Files\Blender Foundation\Blender 3.2\blender.exe" set BLENDER="C:\Program Files\Blender Foundation\Blender 3.2\blender.exe" -if exist "C:\Program Files\Blender Foundation\Blender\blender.exe" set BLENDER="C:\Program Files\Blender Foundation\Blender\blender.exe" -if exist "C:\Program Files (x86)\Steam\steamapps\common\Blender\blender.exe" set BLENDER="C:\Program Files (x86)\Steam\steamapps\common\Blender\blender.exe" +for /f "usebackq delims=" %%A in (`powershell -command "(Get-ItemProperty HKLM:\Software\\Microsoft\Windows\CurrentVersion\Uninstall\* | Select-Object DisplayName,DisplayVersion,InstallLocation | Where-Object {$_.DisplayName -eq \"Blender\"} | Sort -Property DisplayVersion | Select-Object -Last 1 ).DisplayVersion"`) do set version=%%A +for /f "usebackq delims=" %%A in (`powershell -command "(Get-ItemProperty HKLM:\Software\\Microsoft\Windows\CurrentVersion\Uninstall\* | Select-Object DisplayName,DisplayVersion,InstallLocation | Where-Object {$_.DisplayName -eq \"Blender\"} | Sort -Property DisplayVersion | Select-Object -Last 1 ).InstallLocation"`) do set blender=%%A +set blender=%blender:"=% +timeout 3 + +echo "VRMアドオンの最新版を取得中…" curl -L -o "%~dp0VRM_Addon_for_Blender-release.zip" https://github.com/saturday06/VRM_Addon_for_Blender/raw/release-archive/VRM_Addon_for_Blender-release.zip +if "%blender%" == "" ( +echo "Blenderが検出できませんでした。インストーラをダウンロードし、インストールします" +curl -L -o "%~dp0Blender.msi" https://mirrors.aliyun.com/blender/release/Blender3.2/blender-3.2.2-windows-x64.msi +Blender.msi +goto first +) +set blender='%blender%' + +for /f "usebackq delims=" %%A in (`powershell -command "Join-Path %blender% blender.exe"`) do set blender=%%A +set blender="%blender%" +:cycle + set VRM=%1 +set OUTPUT="%~1-converted.glb" echo BLENDER = %BLENDER% echo VRM = %VRM% +echo OUTPUT = %OUTPUT% echo ADDONFILE = "%~dp0VRM_Addon_for_Blender-release.zip" IF NOT DEFINED BLENDER goto error @@ -24,8 +39,6 @@ IF NOT DEFINED VRM goto error-drop --python "%~dp0licensecheck.py"^ -- --input %VRM%^ --addonfile "%~dp0VRM_Addon_for_Blender-release.zip" - -echo ライセンス確認お願いします goto end :error @@ -40,6 +53,4 @@ echo VRMファイルをドラッグ&ドロップで入れてください pause :end -del "%~dp0VRM_Addon_for_Blender-release.zip" - endlocal