Initial commit: Fusion->Blender->GLB pipeline + contract for ThreeJS bridge
This commit is contained in:
64
build_glb.bat
Normal file
64
build_glb.bat
Normal file
@@ -0,0 +1,64 @@
|
||||
@echo off
|
||||
REM ============================================================
|
||||
REM build_glb.bat
|
||||
REM Lancia Blender in background per ricostruire il GLB
|
||||
REM partendo dall'export Fusion (export\hierarchy.json).
|
||||
REM
|
||||
REM Uso: doppio click, oppure:
|
||||
REM build_glb.bat (default: export\ -> export\plotter.glb)
|
||||
REM build_glb.bat C:\percorso\export (cartella custom)
|
||||
REM build_glb.bat C:\percorso\export out.glb (output custom)
|
||||
REM ============================================================
|
||||
|
||||
setlocal
|
||||
|
||||
REM --- Path Blender (modifica qui se cambi versione) ---
|
||||
set "BLENDER=C:\Program Files\Blender Foundation\Blender 4.2\blender.exe"
|
||||
|
||||
REM --- Argomenti ---
|
||||
set "EXPORT_DIR=%~1"
|
||||
if "%EXPORT_DIR%"=="" set "EXPORT_DIR=%~dp0export"
|
||||
|
||||
set "OUTPUT=%~2"
|
||||
if "%OUTPUT%"=="" set "OUTPUT=%EXPORT_DIR%\plotter.glb"
|
||||
|
||||
set "HIERARCHY=%EXPORT_DIR%\hierarchy.json"
|
||||
set "SCRIPT=%~dp0build_glb_from_fusion_export.py"
|
||||
|
||||
REM --- Controlli ---
|
||||
if not exist "%BLENDER%" (
|
||||
echo [ERRORE] Blender non trovato in: %BLENDER%
|
||||
echo Modifica la variabile BLENDER in questo file.
|
||||
pause
|
||||
exit /b 1
|
||||
)
|
||||
if not exist "%HIERARCHY%" (
|
||||
echo [ERRORE] hierarchy.json non trovato in: %HIERARCHY%
|
||||
echo Lancia prima l'export da Fusion 360.
|
||||
pause
|
||||
exit /b 1
|
||||
)
|
||||
if not exist "%SCRIPT%" (
|
||||
echo [ERRORE] Script Blender non trovato: %SCRIPT%
|
||||
pause
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
echo.
|
||||
echo Blender: %BLENDER%
|
||||
echo Script: %SCRIPT%
|
||||
echo Hierarchy: %HIERARCHY%
|
||||
echo Output: %OUTPUT%
|
||||
echo.
|
||||
|
||||
"%BLENDER%" --background --python "%SCRIPT%" -- "%HIERARCHY%" "%OUTPUT%"
|
||||
|
||||
set "RC=%ERRORLEVEL%"
|
||||
echo.
|
||||
if "%RC%"=="0" (
|
||||
echo [OK] GLB generato: %OUTPUT%
|
||||
) else (
|
||||
echo [ERRORE] Blender ha terminato con codice %RC%
|
||||
)
|
||||
pause
|
||||
endlocal
|
||||
Reference in New Issue
Block a user