Browse Source

Added Body Animation Compression Setup to Repo

master
TimV-BREX\TimVoelker 1 month ago
commit
19a193eca1
  1. BIN
      Body Animation Compression/Optimized/AS_MC_Nath_01_Take147_TalkingUp2_Cascadeur.glb
  2. BIN
      Body Animation Compression/Optimized/AS_MC_Nath_01_Take158_TalkingUp1_Cascadeur.glb
  3. BIN
      Body Animation Compression/Optimized/AS_MC_Nath_01_Take158_TalkingUp2_Cascadeur.glb
  4. BIN
      Body Animation Compression/Optimized/AS_MC_Nath_01_Take158_TalkingUp4_Cascadeur.glb
  5. BIN
      Body Animation Compression/Optimized/AS_MC_Nath_01_Take158_TalkingUp6_Cascadeur.glb
  6. BIN
      Body Animation Compression/Optimized/AS_MC_Nath_01_Take160_TalkingUp1_Cascadeur.glb
  7. BIN
      Body Animation Compression/Original/AS_MC_Nath_01_Take147_TalkingUp2_Cascadeur.FBX
  8. BIN
      Body Animation Compression/Original/AS_MC_Nath_01_Take158_TalkingUp1_Cascadeur.FBX
  9. BIN
      Body Animation Compression/Original/AS_MC_Nath_01_Take158_TalkingUp2_Cascadeur.FBX
  10. BIN
      Body Animation Compression/Original/AS_MC_Nath_01_Take158_TalkingUp4_Cascadeur.FBX
  11. BIN
      Body Animation Compression/Original/AS_MC_Nath_01_Take158_TalkingUp6_Cascadeur.FBX
  12. BIN
      Body Animation Compression/Original/AS_MC_Nath_01_Take160_TalkingUp1_Cascadeur.FBX
  13. 1332
      Body Animation Compression/anim_optimize.py
  14. BIN
      Body Animation Compression/gltfpack.exe
  15. 220
      Body Animation Compression/optimize_all.bat
  16. 219
      Body Animation Compression/optimize_log.txt
  17. 101
      Body Animation Compression/threejs-meshopt-checkliste.md

BIN
Body Animation Compression/Optimized/AS_MC_Nath_01_Take147_TalkingUp2_Cascadeur.glb

Binary file not shown.

BIN
Body Animation Compression/Optimized/AS_MC_Nath_01_Take158_TalkingUp1_Cascadeur.glb

Binary file not shown.

BIN
Body Animation Compression/Optimized/AS_MC_Nath_01_Take158_TalkingUp2_Cascadeur.glb

Binary file not shown.

BIN
Body Animation Compression/Optimized/AS_MC_Nath_01_Take158_TalkingUp4_Cascadeur.glb

Binary file not shown.

BIN
Body Animation Compression/Optimized/AS_MC_Nath_01_Take158_TalkingUp6_Cascadeur.glb

Binary file not shown.

BIN
Body Animation Compression/Optimized/AS_MC_Nath_01_Take160_TalkingUp1_Cascadeur.glb

Binary file not shown.

BIN
Body Animation Compression/Original/AS_MC_Nath_01_Take147_TalkingUp2_Cascadeur.FBX

Binary file not shown.

BIN
Body Animation Compression/Original/AS_MC_Nath_01_Take158_TalkingUp1_Cascadeur.FBX

Binary file not shown.

BIN
Body Animation Compression/Original/AS_MC_Nath_01_Take158_TalkingUp2_Cascadeur.FBX

Binary file not shown.

BIN
Body Animation Compression/Original/AS_MC_Nath_01_Take158_TalkingUp4_Cascadeur.FBX

Binary file not shown.

BIN
Body Animation Compression/Original/AS_MC_Nath_01_Take158_TalkingUp6_Cascadeur.FBX

Binary file not shown.

BIN
Body Animation Compression/Original/AS_MC_Nath_01_Take160_TalkingUp1_Cascadeur.FBX

Binary file not shown.

1332
Body Animation Compression/anim_optimize.py

File diff suppressed because it is too large

BIN
Body Animation Compression/gltfpack.exe

Binary file not shown.

220
Body Animation Compression/optimize_all.bat

@ -0,0 +1,220 @@
@echo off
setlocal enabledelayedexpansion
title Animation Optimizer - Unreal FBX to Web GLB
mode con: cols=104 lines=45 >nul 2>&1
cls
REM ===========================================================================
REM optimize_all.bat
REM
REM Ordnerstruktur (alles neben dieser .bat):
REM Original\ FBX aus Unreal hier reinlegen
REM Optimized\ GLB landen hier, gleiche Basisnamen
REM optimize_log.txt vollstaendiges Protokoll des letzten Laufs
REM
REM Aufruf:
REM optimize_all.bat interaktiv
REM optimize_all.bat --force ohne Nachfrage alles neu bauen
REM optimize_all.bat --report Key-Verteilung pro Bone ins Log
REM optimize_all.bat --verbose Blender-Ausgabe auf der Konsole
REM optimize_all.bat --rot-tol 0.5 Toleranz ueberschreiben
REM
REM Zusaetzliche Argumente werden an anim_optimize.py durchgereicht.
REM ===========================================================================
set BLENDER="C:\Program Files\Blender Foundation\Blender 4.5\blender.exe"
REM gltfpack (meshoptimizer) - optionaler zweiter Durchlauf.
REM Leer lassen zum Deaktivieren, oder Pfad zur gltfpack.exe eintragen.
REM Liegt sie neben dieser .bat oder im PATH, wird sie automatisch gefunden.
set GLTFPACK=
REM Kompression: -cc = EXT_meshopt_compression (three.js r122+ mit
REM setMeshoptDecoder). -cz = KHR_meshopt_compression, kleiner, aber neuer -
REM erst umstellen, wenn dein three.js das liest. Kennt dein gltfpack -cz
REM nicht, ersetzt das Skript es automatisch durch -cc.
set PACKOPTS=-cc -kn -af 30
REM --- ANSI-Farben. Faellt sauber auf farblos zurueck, wenn nicht verfuegbar.
set "ESC="
for /f %%a in ('echo prompt $E^| cmd') do set "ESC=%%a"
if defined ESC (
set "R=!ESC![0m" & set "B=!ESC![1m"
set "DIM=!ESC![90m" & set "CY=!ESC![96m"
set "GN=!ESC![92m" & set "YE=!ESC![93m"
set "RD=!ESC![91m" & set "WH=!ESC![97m"
) else (
set "R=" & set "B=" & set "DIM=" & set "CY=" & set "GN=" & set "YE=" & set "RD=" & set "WH="
)
set "LINE=------------------------------------------------------------------------------"
set "DBL==============================================================================="
REM ROOT = mit abschliessendem Backslash, fuer Pfad-Verkettung
REM ROOTA = OHNE Backslash, zum Uebergeben als Argument. Ein Backslash direkt
REM vor dem schliessenden " wuerde das Anfuehrungszeichen escapen und
REM die restliche Kommandozeile in ein Argument ziehen.
set ROOT=%~dp0
set ROOTA=%ROOT:~0,-1%
set IN=%ROOT%Original
set OUT=%ROOT%Optimized
echo.
echo %CY%%DBL%%R%
echo %B%%WH%ANIMATION OPTIMIZER%R% %DIM%Unreal FBX -^> Web GLB%R%
echo %CY%%DBL%%R%
echo.
REM --- Blender finden --------------------------------------------------------
if not exist %BLENDER% (
for /d %%D in ("C:\Program Files\Blender Foundation\Blender *") do (
if exist "%%D\blender.exe" set BLENDER="%%D\blender.exe"
)
)
if not exist %BLENDER% (
for %%P in (blender.exe) do if not "%%~$PATH:P"=="" set BLENDER="%%~$PATH:P"
)
if not exist %BLENDER% (
echo %RD%[ FEHLER ]%R% Blender nicht gefunden.
echo Pfad oben in dieser .bat anpassen ^(Variable BLENDER^).
echo.
pause
exit /b 1
)
if not exist "%ROOT%anim_optimize.py" (
echo %RD%[ FEHLER ]%R% anim_optimize.py fehlt.
echo Die .py muss neben dieser .bat liegen:
echo %DIM%%ROOTA%%R%
echo.
pause
exit /b 1
)
REM --- gltfpack suchen -------------------------------------------------------
if not defined GLTFPACK (
if exist "%ROOT%gltfpack.exe" set GLTFPACK=%ROOT%gltfpack.exe
)
if not defined GLTFPACK (
for %%P in (gltfpack.exe) do if not "%%~$PATH:P"=="" set GLTFPACK=%%~$PATH:P
)
set PACKARG=
if defined GLTFPACK set PACKARG=--gltfpack "%GLTFPACK%" --gltfpack-args "%PACKOPTS%"
if not exist "%IN%" mkdir "%IN%"
if not exist "%OUT%" mkdir "%OUT%"
REM --- Bestand pruefen -------------------------------------------------------
set /a TOTAL=0
set /a EXISTING=0
for %%F in ("%IN%\*.fbx") do (
set /a TOTAL+=1
if exist "%OUT%\%%~nF.glb" set /a EXISTING+=1
)
set /a REST=TOTAL-EXISTING
echo %DIM%Quelle %R% Original\ %B%%TOTAL%%R% FBX gefunden
echo %DIM%Ziel %R% Optimized\ %B%%EXISTING%%R% davon bereits gebaut
echo %DIM%Blender %R% %DIM%%BLENDER%%R%
if defined GLTFPACK (
echo %DIM%gltfpack%R% %GN%aktiv%R% %DIM%%PACKOPTS%%R%
) else (
echo %DIM%gltfpack%R% %DIM%nicht gefunden - Schritt wird uebersprungen%R%
)
echo %DIM%%LINE%%R%
if %TOTAL%==0 (
echo.
echo %YE%[ NICHTS ZU TUN ]%R% Keine FBX in Original\ gefunden.
echo Exporte aus Unreal dort ablegen und neu starten.
echo.
pause
exit /b 0
)
REM --- Wurde --force schon per Kommandozeile mitgegeben? ---------------------
set EXTRA=%*
set PREFORCE=
echo.%EXTRA%| find /i "--force" >nul && set PREFORCE=1
REM --- Nachfrage -------------------------------------------------------------
if defined PREFORCE goto :run
if %EXISTING%==0 goto :run
echo.
echo %YE%%EXISTING% von %TOTAL% Animationen liegen bereits in Optimized\%R%
echo.
echo %B%[J]%R% neu optimieren und ueberschreiben %DIM%alle %TOTAL%%R%
echo %B%[N]%R% vorhandene behalten %DIM%nur die restlichen %REST%%R%
echo %B%[A]%R% abbrechen
echo.
where choice >nul 2>&1
if errorlevel 1 goto :fallback
choice /c JNA /n /m " Auswahl [J/N/A]: "
if errorlevel 3 goto :abort
if errorlevel 2 goto :run
set EXTRA=%EXTRA% --force
goto :run
:fallback
set ANSWER=
set /p ANSWER=" Auswahl [J/N/A]: "
if /i "%ANSWER%"=="A" goto :abort
if /i "%ANSWER%"=="J" set EXTRA=%EXTRA% --force
if /i "%ANSWER%"=="Y" set EXTRA=%EXTRA% --force
goto :run
REM --- Lauf ------------------------------------------------------------------
:run
echo.
%BLENDER% -b -noaudio --factory-startup --python "%ROOT%anim_optimize.py" -- ^
--root "%ROOTA%" ^
--in-dir Original ^
--out-dir Optimized ^
--format GLB ^
--rot-tol 0.25 ^
--loc-tol-mm 0.5 ^
--loose-rot-tol 1.0 ^
--loose-bones twist ^
--expect-fps 30 ^
--scale-tol 0.0005 ^
--scale-snap 0.001 ^
--anim-only ^
--round 4 ^
--log optimize_log.txt ^
%PACKARG% ^
%EXTRA%
set RC=%errorlevel%
echo %DIM%%LINE%%R%
if %RC%==0 (
echo %GN%[ FERTIG ]%R% Alle Animationen gebaut.
) else (
echo %RD%[ FEHLER ]%R% Mindestens eine Datei ist fehlgeschlagen.
echo Details stehen im Protokoll:
echo %DIM%%ROOT%optimize_log.txt%R%
)
echo.
where choice >nul 2>&1
if errorlevel 1 goto :end
choice /c LON /n /t 15 /d N /m " [L]og oeffnen [O]rdner oeffnen [N]ichts (15s) "
if errorlevel 3 goto :end
if errorlevel 2 goto :openfolder
start "" notepad "%ROOT%optimize_log.txt"
goto :end
:openfolder
start "" explorer "%OUT%"
:end
echo.
exit /b %RC%
:abort
echo.
echo %DIM%Abgebrochen.%R%
echo.
timeout /t 2 >nul
exit /b 0

219
Body Animation Compression/optimize_log.txt

@ -0,0 +1,219 @@
==============================================================================
anim_optimize Protokoll
Zeit : 2026-09-08 09:24:01
Blender : 4.5.7 LTS
Python : 3.11.11
Plattform : win32
Quelle : C:\Users\TimVoelker\Desktop\Web Animation Optimierung\Original
Ziel : C:\Users\TimVoelker\Desktop\Web Animation Optimierung\Optimized
------------------------------------------------------------------------------
Einstellungen
anim_only True
deform_only False
drop_bones
expect_fps 30.0
force True
format GLB
gltfpack C:\Users\TimVoelker\Desktop\Web Animation Optimierung\gltfpack.exe
gltfpack_args -cc -kn -af 30
in_dir Original
loc_tol None
loc_tol_mm 0.5
log optimize_log.txt
loose_bones twist
loose_rot_tol 1.0
nd 4
no_color False
no_progress False
out_dir Optimized
report False
report_top 20
root C:\Users\TimVoelker\Desktop\Web Animation Optimierung
rot_tol 0.25
scale_snap 0.001
scale_tol 0.0005
verbose False
gltfpack-version gltfpack 1.2
==============================================================================
==============================================================================
Quelle : C:\Users\TimVoelker\Desktop\Web Animation Optimierung\Original
Ziel : C:\Users\TimVoelker\Desktop\Web Animation Optimierung\Optimized (GLB)
Dateien: 6 gesamt, 6 zu bauen, 0 uebersprungen
Tol. : rot 0.250 deg | loc 0.5 mm | loose 1.000 deg (twist)
Packing: aktiv -cc -kn -af 30
==============================================================================
FBX version: 7700
Exporter-Parameter in dieser Blender-Version unbekannt, ignoriert: export_colors
INFO
Draco mesh compression is available, use library at C:\Program Files\Blender Foundation\Blender 4.5\4.5\scripts\addons_core\io_scene_gltf2\extern_draco.dll
09:24:04 | INFO: Starting glTF 2.0 export
09:24:05 | INFO: Finished glTF 2.0 export in 1.3714752197265625 s
gltfpack: C:\Users\TimVoelker\Desktop\Web Animation Optimierung\gltfpack.exe -i C:\Users\TimVoelker\Desktop\Web Animation Optimierung\Optimized\AS_MC_Nath_01_Take147_TalkingUp2_Cascadeur.glb -o C:\Users\TimVoelker\Desktop\Web Animation Optimierung\Optimized\AS_MC_Nath_01_Take147_TalkingUp2_Cascadeur.glb.pack.glb -cc -kn -af 30
OK AS_MC_Nath_01_Take147~ 9.20 MB -> 0.32 -> 92 KB 1.0% keys 103163 -> 22779 4.5s
------------------------------------------------------------------------------
DATEI AS_MC_Nath_01_Take147_TalkingUp2_Cascadeur
------------------------------------------------------------------------------
Quelle AS_MC_Nath_01_Take147_TalkingUp2_Cascadeur.FBX (9.202 MB)
Ziel AS_MC_Nath_01_Take147_TalkingUp2_Cascadeur.glb (0.094 MB)
gltfpack 0.324 MB -> 0.094 MB (29.1%)
Dauer 4.53 s
Samplerate 30 fps, Key-Step 1 -> 30 Keys/s
Frame-Bereich 1 bis 250
Einheiten scale_length 1, Armature-Scale (0.01, 0.01, 0.01)
1 Keyframe-Einheit = 10 mm
Positionstol. 0.05 BU = 0.5 mm (aus 0.5 mm)
Bones 322 importiert, 0 entfernt, 322 exportiert
F-Curves 3229 -> 1779 (0 verwaist, 1450 konstant entfernt, 1342 auf 1 Key)
Keys 103163 -> 22779 (77.9% entfernt)
location 8607 -> 1131 (86.9%)
rotation_quaternion 94556 -> 21648 (77.1%)
FBX version: 7700
Exporter-Parameter in dieser Blender-Version unbekannt, ignoriert: export_colors
09:24:07 | INFO: Starting glTF 2.0 export
09:24:08 | INFO: Finished glTF 2.0 export in 0.9818012714385986 s
gltfpack: C:\Users\TimVoelker\Desktop\Web Animation Optimierung\gltfpack.exe -i C:\Users\TimVoelker\Desktop\Web Animation Optimierung\Optimized\AS_MC_Nath_01_Take158_TalkingUp1_Cascadeur.glb -o C:\Users\TimVoelker\Desktop\Web Animation Optimierung\Optimized\AS_MC_Nath_01_Take158_TalkingUp1_Cascadeur.glb.pack.glb -cc -kn -af 30
OK AS_MC_Nath_01_Take158~ 7.43 MB -> 0.31 -> 87 KB 1.2% keys 65781 -> 19851 2.8s
------------------------------------------------------------------------------
DATEI AS_MC_Nath_01_Take158_TalkingUp1_Cascadeur
------------------------------------------------------------------------------
Quelle AS_MC_Nath_01_Take158_TalkingUp1_Cascadeur.FBX (7.434 MB)
Ziel AS_MC_Nath_01_Take158_TalkingUp1_Cascadeur.glb (0.089 MB)
gltfpack 0.308 MB -> 0.089 MB (28.8%)
Dauer 2.85 s
Samplerate 30 fps, Key-Step 1 -> 30 Keys/s
Frame-Bereich 1 bis 250
Einheiten scale_length 1, Armature-Scale (0.01, 0.01, 0.01)
1 Keyframe-Einheit = 10 mm
Positionstol. 0.05 BU = 0.5 mm (aus 0.5 mm)
Bones 322 importiert, 0 entfernt, 322 exportiert
F-Curves 3229 -> 1773 (0 verwaist, 1456 konstant entfernt, 1392 auf 1 Key)
Keys 65781 -> 19851 (69.8% entfernt)
location 6501 -> 1059 (83.7%)
rotation_quaternion 59280 -> 18792 (68.3%)
FBX version: 7700
Exporter-Parameter in dieser Blender-Version unbekannt, ignoriert: export_colors
09:24:10 | INFO: Starting glTF 2.0 export
09:24:11 | INFO: Finished glTF 2.0 export in 0.9810314178466797 s
gltfpack: C:\Users\TimVoelker\Desktop\Web Animation Optimierung\gltfpack.exe -i C:\Users\TimVoelker\Desktop\Web Animation Optimierung\Optimized\AS_MC_Nath_01_Take158_TalkingUp2_Cascadeur.glb -o C:\Users\TimVoelker\Desktop\Web Animation Optimierung\Optimized\AS_MC_Nath_01_Take158_TalkingUp2_Cascadeur.glb.pack.glb -cc -kn -af 30
OK AS_MC_Nath_01_Take158~ 7.43 MB -> 0.30 -> 86 KB 1.2% keys 72854 -> 17085 2.9s
------------------------------------------------------------------------------
DATEI AS_MC_Nath_01_Take158_TalkingUp2_Cascadeur
------------------------------------------------------------------------------
Quelle AS_MC_Nath_01_Take158_TalkingUp2_Cascadeur.FBX (7.434 MB)
Ziel AS_MC_Nath_01_Take158_TalkingUp2_Cascadeur.glb (0.088 MB)
gltfpack 0.295 MB -> 0.088 MB (29.7%)
Dauer 2.88 s
Samplerate 30 fps, Key-Step 1 -> 30 Keys/s
Frame-Bereich 1 bis 250
Einheiten scale_length 1, Armature-Scale (0.01, 0.01, 0.01)
1 Keyframe-Einheit = 10 mm
Positionstol. 0.05 BU = 0.5 mm (aus 0.5 mm)
Bones 322 importiert, 0 entfernt, 322 exportiert
F-Curves 3229 -> 1790 (0 verwaist, 1439 konstant entfernt, 1367 auf 1 Key)
Keys 72854 -> 17085 (76.5% entfernt)
location 5490 -> 1041 (81.0%)
rotation_quaternion 67364 -> 16044 (76.2%)
FBX version: 7700
Exporter-Parameter in dieser Blender-Version unbekannt, ignoriert: export_colors
09:24:13 | INFO: Starting glTF 2.0 export
09:24:14 | INFO: Finished glTF 2.0 export in 1.0244910717010498 s
gltfpack: C:\Users\TimVoelker\Desktop\Web Animation Optimierung\gltfpack.exe -i C:\Users\TimVoelker\Desktop\Web Animation Optimierung\Optimized\AS_MC_Nath_01_Take158_TalkingUp4_Cascadeur.glb -o C:\Users\TimVoelker\Desktop\Web Animation Optimierung\Optimized\AS_MC_Nath_01_Take158_TalkingUp4_Cascadeur.glb.pack.glb -cc -kn -af 30
OK AS_MC_Nath_01_Take158~ 7.82 MB -> 0.32 -> 89 KB 1.2% keys 87693 -> 21320 3.1s
------------------------------------------------------------------------------
DATEI AS_MC_Nath_01_Take158_TalkingUp4_Cascadeur
------------------------------------------------------------------------------
Quelle AS_MC_Nath_01_Take158_TalkingUp4_Cascadeur.FBX (7.821 MB)
Ziel AS_MC_Nath_01_Take158_TalkingUp4_Cascadeur.glb (0.091 MB)
gltfpack 0.316 MB -> 0.091 MB (28.9%)
Dauer 3.09 s
Samplerate 30 fps, Key-Step 1 -> 30 Keys/s
Frame-Bereich 1 bis 250
Einheiten scale_length 1, Armature-Scale (0.01, 0.01, 0.01)
1 Keyframe-Einheit = 10 mm
Positionstol. 0.05 BU = 0.5 mm (aus 0.5 mm)
Bones 322 importiert, 0 entfernt, 322 exportiert
F-Curves 3229 -> 1789 (0 verwaist, 1440 konstant entfernt, 1317 auf 1 Key)
Keys 87693 -> 21320 (75.7% entfernt)
location 7497 -> 1068 (85.8%)
rotation_quaternion 80196 -> 20252 (74.7%)
FBX version: 7700
Exporter-Parameter in dieser Blender-Version unbekannt, ignoriert: export_colors
09:24:16 | INFO: Starting glTF 2.0 export
09:24:16 | INFO: Finished glTF 2.0 export in 0.8787093162536621 s
gltfpack: C:\Users\TimVoelker\Desktop\Web Animation Optimierung\gltfpack.exe -i C:\Users\TimVoelker\Desktop\Web Animation Optimierung\Optimized\AS_MC_Nath_01_Take158_TalkingUp6_Cascadeur.glb -o C:\Users\TimVoelker\Desktop\Web Animation Optimierung\Optimized\AS_MC_Nath_01_Take158_TalkingUp6_Cascadeur.glb.pack.glb -cc -kn -af 30
OK AS_MC_Nath_01_Take158~ 6.94 MB -> 0.30 -> 87 KB 1.3% keys 68083 -> 17660 2.5s
------------------------------------------------------------------------------
DATEI AS_MC_Nath_01_Take158_TalkingUp6_Cascadeur
------------------------------------------------------------------------------
Quelle AS_MC_Nath_01_Take158_TalkingUp6_Cascadeur.FBX (6.937 MB)
Ziel AS_MC_Nath_01_Take158_TalkingUp6_Cascadeur.glb (0.089 MB)
gltfpack 0.298 MB -> 0.089 MB (29.8%)
Dauer 2.53 s
Samplerate 30 fps, Key-Step 1 -> 30 Keys/s
Frame-Bereich 1 bis 250
Einheiten scale_length 1, Armature-Scale (0.01, 0.01, 0.01)
1 Keyframe-Einheit = 10 mm
Positionstol. 0.05 BU = 0.5 mm (aus 0.5 mm)
Bones 322 importiert, 0 entfernt, 322 exportiert
F-Curves 3229 -> 1783 (0 verwaist, 1446 konstant entfernt, 1341 auf 1 Key)
Keys 68083 -> 17660 (74.1% entfernt)
location 5451 -> 1080 (80.2%)
rotation_quaternion 62632 -> 16580 (73.5%)
FBX version: 7700
Exporter-Parameter in dieser Blender-Version unbekannt, ignoriert: export_colors
09:24:18 | INFO: Starting glTF 2.0 export
09:24:19 | INFO: Finished glTF 2.0 export in 0.8631854057312012 s
gltfpack: C:\Users\TimVoelker\Desktop\Web Animation Optimierung\gltfpack.exe -i C:\Users\TimVoelker\Desktop\Web Animation Optimierung\Optimized\AS_MC_Nath_01_Take160_TalkingUp1_Cascadeur.glb -o C:\Users\TimVoelker\Desktop\Web Animation Optimierung\Optimized\AS_MC_Nath_01_Take160_TalkingUp1_Cascadeur.glb.pack.glb -cc -kn -af 30
OK AS_MC_Nath_01_Take160~ 7.00 MB -> 0.30 -> 87 KB 1.3% keys 95470 -> 18254 2.6s
------------------------------------------------------------------------------
DATEI AS_MC_Nath_01_Take160_TalkingUp1_Cascadeur
------------------------------------------------------------------------------
Quelle AS_MC_Nath_01_Take160_TalkingUp1_Cascadeur.FBX (6.996 MB)
Ziel AS_MC_Nath_01_Take160_TalkingUp1_Cascadeur.glb (0.089 MB)
gltfpack 0.302 MB -> 0.089 MB (29.3%)
Dauer 2.61 s
Samplerate 30 fps, Key-Step 1 -> 30 Keys/s
Frame-Bereich 1 bis 250
Einheiten scale_length 1, Armature-Scale (0.01, 0.01, 0.01)
1 Keyframe-Einheit = 10 mm
Positionstol. 0.05 BU = 0.5 mm (aus 0.5 mm)
Bones 322 importiert, 0 entfernt, 322 exportiert
F-Curves 3229 -> 1838 (0 verwaist, 1391 konstant entfernt, 1222 auf 1 Key)
Keys 95470 -> 18254 (80.9% entfernt)
location 10074 -> 1098 (89.1%)
rotation_quaternion 85396 -> 17156 (79.9%)
------------------------------------------------------------------------------
6 gebaut, 0 uebersprungen, 0 fehlgeschlagen Laufzeit 00:18
Gesamt: 45.83 MB -> 0.54 MB (1.2%, 45.29 MB gespart)
davon durch gltfpack: 1.30 MB
Ausgabe
6 Datei(en) 527 KB gesamt 88 KB im Schnitt 87 KB Median
kleinste 86 KB AS_MC_Nath_01_Take158_TalkingUp2_Cascadeur
groesste 92 KB AS_MC_Nath_01_Take147_TalkingUp2_Cascadeur
Alle Ergebnisdateien nach Groesse:
92 KB AS_MC_Nath_01_Take147_TalkingUp2_Cascadeur
89 KB AS_MC_Nath_01_Take158_TalkingUp4_Cascadeur
87 KB AS_MC_Nath_01_Take158_TalkingUp6_Cascadeur
87 KB AS_MC_Nath_01_Take158_TalkingUp1_Cascadeur
87 KB AS_MC_Nath_01_Take160_TalkingUp1_Cascadeur
86 KB AS_MC_Nath_01_Take158_TalkingUp2_Cascadeur
Protokoll: C:\Users\TimVoelker\Desktop\Web Animation Optimierung\optimize_log.txt
==============================================================================

101
Body Animation Compression/threejs-meshopt-checkliste.md

@ -0,0 +1,101 @@
# three.js: meshopt-komprimierte Animations-GLB laden
Checkliste für die Web-Animationspipeline. Die GLB-Dateien aus `Optimized/`
enthalten **nur Animation** — kein Mesh, kein Skin — und sind mit gltfpack
quantisiert und über `EXT_meshopt_compression` komprimiert.
---
## 1. Decoder importieren und registrieren
```js
import { GLTFLoader } from 'three/examples/jsm/loaders/GLTFLoader.js';
import { MeshoptDecoder } from 'three/examples/jsm/libs/meshopt_decoder.module.js';
await MeshoptDecoder.ready;
const loader = new GLTFLoader();
loader.setMeshoptDecoder(MeshoptDecoder);
```
Ohne `setMeshoptDecoder` schlägt das Laden fehl. three.js unterstützt
`EXT_meshopt_compression` ab **r122**.
## 2. Loader einmal bauen und wiederverwenden
Der Decoder ist ein WASM-Modul. Einmal instanziieren, nicht pro Datei.
## 3. Charakter separat laden
Mesh mit Skelett einmal laden, danach nur noch die Animations-GLBs.
## 4. Clip auf den Charakter anwenden
```js
const anim = await loader.loadAsync(
'/Optimized/AS_MC_Nath_01_Take147_TalkingUp2_Cascadeur.glb'
);
const mixer = new THREE.AnimationMixer(characterRoot);
mixer.clipAction(anim.animations[0], characterRoot).play();
```
Im Render-Loop nicht vergessen:
```js
mixer.update(clock.getDelta());
```
## 5. Namen prüfen — wahrscheinlichster Stolperstein
```js
console.log(anim.animations[0].tracks.slice(0, 3).map(t => t.name));
```
Erwartet: `"spine_01.quaternion"` und ähnlich.
**Wichtig:** Findet der Mixer einen Bone-Namen nicht, spielt der Clip stumm ab
— ohne Fehlermeldung. Einmal aktiv gegenprüfen.
Falls Namen nicht passen (three.js schreibt Punkte und Doppelpunkte um):
`SkeletonUtils.retarget` oder eine Umbenennungstabelle verwenden.
## 6. Kein DRACOLoader nötig
Draco komprimiert nur Geometrie. Die Animationsdateien haben keine.
## 7. Brotli auf dem Server aktivieren
Die meshopt-Codecs sind darauf ausgelegt, dass zusätzlich mit gzip oder Brotli
komprimiert wird — das steht ausdrücklich in der Doku. Ohne das bleibt ein Teil
des Gewinns liegen.
## 8. Bei `-cz` aufpassen
Falls später auf `KHR_meshopt_compression` umgestellt wird: erst prüfen, ob die
eingesetzte three.js-Version das liest. `EXT_meshopt_compression` (Flag `-cc`)
ist die abgesicherte Variante.
---
## Debugging
| Symptom | Ursache |
|---|---|
| Fehler beim Laden, Extension nicht unterstützt | `setMeshoptDecoder` fehlt |
| Clip lädt, aber nichts bewegt sich | Bone-Namen passen nicht — Punkt 5 |
| Nur Teile des Körpers animiert | Skelett-Hierarchie weicht ab |
| Datei viel größer als erwartet | Brotli auf dem Server nicht aktiv |
## Hinweise zur Pipeline
- Die FBX in `Original/` sind die Wahrheit. Die GLB sind Auslieferungsformat,
kein Arbeitsformat.
- Blenders eingebauter Importer kann meshopt-GLB **nicht** öffnen. Dafür gibt es
das Add-on *Compressed GLB Importer* (extensions.blender.org), oder man
dekomprimiert vorher mit glTF-Transform:
`npx @gltf-transform/cli cp packed.glb plain.glb`
- Gesichtsanimationen liegen in separaten Dateien. Dort sind die
Bone-Bewegungsumfänge klein, deshalb dort mit deutlich strengerer
`--rot-tol` starten (z. B. 0.05 statt 0.25) und erst nach Sichtprüfung
hochgehen.
Loading…
Cancel
Save