Skip to content

Commit

Permalink
Merge pull request #2 from kazu0617/pr-fix/blender-path
Browse files Browse the repository at this point in the history
Pathの取り方を変更。
Steam版で引き続き問題あったらIssueたてて
  • Loading branch information
kazu0617 authored Aug 23, 2022
2 parents 6701fb7 + e3bf46a commit 69edd92
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 12 deletions.
5 changes: 4 additions & 1 deletion _convert.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion _convert_manual.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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"

Expand Down
31 changes: 21 additions & 10 deletions _license-check.bat
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand All @@ -40,6 +53,4 @@ echo VRMファイルをドラッグ&ドロップで入れてください
pause
:end

del "%~dp0VRM_Addon_for_Blender-release.zip"

endlocal

0 comments on commit 69edd92

Please sign in to comment.