Skip to content

WhileRomeBurns/GLTFMergeAnimations

Repository files navigation

GLTF Logo

GLTFMergeAnimations

Uses gltf-transform to process multple gltf files with different animations (shared joint hierarchy) and merge them into a single output file containing the collected animations. The original use case was taking Miximo mocap data files which had been exported to fbx's and converted to glb's. To have one glb file per character with all animations, blender could be used to manually gather the animations onto one skin in the NLE. This can be a bit slow and error prone with many animations, so gltf-transform scripting to the rescue! The merged glb can be further optimized by running gltf-transform-cli with the options to recompress textures and geometry (draco).

Merge files were tested in babylonjs and gltf-report.

Requires:

Node.js (v24+)

Install:

  1. git clone https://github.com/WhileRomeBurns/GLTFMergeAnimations
  2. npm install

Running:

Call the script through node with a list of files to merge. The last file is the output of the merged animations. This script assumes that all animations reference the same joint names. Example:

node app.ts run01.glb walk01.glb idle01.glb merged_output.glb

Alternatively, pass in a directory of two or more glb files. The output file will take its name from the directory:

node app.ts /path/to/glbs/example/

and results in an output file next to the example directory:

  • /path/to/glbs/example.glb
  • /path/to/glbs/example/

Running on Windows:

Use the included gltf-merge-animations.bat to call node and run app.ts by including an alias in your powershell user profile:

Set-Alias -Name gltf-merge-animations -Value "C:\path\to\GLTFMergeAnimations\gltf-merge-animations.bat"

and the directory example above becomes:

gltf-merge-animations /path/to/glbs/example/

About

Given two or more glb files with the same joint data, consolidate all animations into the first glb. Original use was combining multiple miximo fbx->glb files into a single glb for babylonjs/threejs.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors