-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
83 additions
and
4 deletions.
There are no files selected for viewing
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
File renamed without changes.
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
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
0
build.sh → build_linux.sh
100755 → 100644
File renamed without changes.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
@echo off | ||
setlocal | ||
|
||
rem Вставьте вашу команду или утилиту (если она нужна) | ||
rem bab | ||
|
||
set targetFile=MiBlend.blend | ||
|
||
rem Получаем PID процесса Blender | ||
for /f "tokens=2" %%a in ('tasklist /FI "IMAGENAME eq blender.exe" /FO LIST ^| find "PID"') do ( | ||
set blenderPID=%%a | ||
) | ||
|
||
rem Если процесс Blender запущен | ||
if defined blenderPID ( | ||
echo Найден процесс Blender с PID: %blenderPID% | ||
|
||
rem Проверяем, открыт ли файл MiBlend.blend | ||
for /f "tokens=*" %%b in ('wmic process where "ProcessId=%blenderPID%" get CommandLine ^| find /I "%targetFile%"') do ( | ||
echo Файл %targetFile% открыт в Blender. Перезапускаем Blender... | ||
|
||
rem Завершаем процесс Blender | ||
taskkill /PID %blenderPID% /F | ||
echo Ожидание завершения процесса Blender... | ||
|
||
rem Ждем завершения процесса | ||
:waitLoop | ||
tasklist /FI "PID eq %blenderPID%" 2>NUL | find "%blenderPID%" > NUL | ||
if %ERRORLEVEL% equ 0 ( | ||
timeout /T 1 > NUL | ||
goto waitLoop | ||
) | ||
|
||
rem Перезапуск Blender | ||
echo Перезапуск Blender... | ||
start "" "C:\Program Files\Blender Foundation\Blender\blender.exe" "C:\path\to\your\MiBlend.blend" | ||
exit /B 0 | ||
) | ||
) else ( | ||
echo Blender не запущен. | ||
) | ||
|
||
endlocal |