Skip to content

crazyramirez/FBX2GLB-Batch-Convert-Optimizer

Repository files navigation



NodeJS APP to Batch Convert fbx files to glb and Fast Optimization (Draco -- Texture Compression).

Setup NodeJS

  • Install NodeJS from https://nodejs.org/en
  • Download or Clone this Repository
  • Open a Terminal (Usign for example VSCode)
  • RUN: npm install (To Install NPM Libraries)

Setup Your FBX Files

  • Copy your FBX Files in "_input" directory, also you can use subdirectories

Convert FBX to GLB

  • RUN: node convert.js
  • Your Files will be converted in "_output" directory using the same structure
  • View the log and wait till finished

Optimize GLB Files

  • RUN: node optimize.mjs
  • Your files located in "_output" directory will be optimized to "_optimized" folder
  • You can tweak optimize.mjs code to adapt it to your needs (ie. const imageFormat = 'webp'; const imageSize = 512;)
  • View the log and wait till finished

Merge GLB Animations

  • Combines animations from a source animation GLB file into a target character GLB file.
  • Retargets rotation keyframes using world-space change-of-basis (Mixamo ↔ UE/Unity compatibility).
  • Automatically maps bone names via normalization rules and custom dictionaries.
  • Discards scale channels and non-root translation channels to avoid limb stretching.
  • Supports posture adjustments (arm and leg spreads, custom per-bone offsets) directly in the configuration section of the script.
  • Cleans up and prunes redundant animation meshes/skins, compresses the output using Draco + resampling, and generates a text file listing all merged animations.
  • RUN: node merge_animations.mjs --character <character_path> --animations <animations_path> --output <output_path>
    • Command line flags:
      • -c or --character: Target character GLB path (default: _input/character.glb)
      • -a or --animations: Source animation GLB path (default: _input/animations.glb)
      • -o or --output: Output GLB path (default: _output/character_combined.glb)
    • Output files:
      • Combined GLB file: _output/character_combined.glb
      • Animation list text file: _output/character_combined_animations.txt

This APP uses FBX2GLTF Library: https://www.npmjs.com/package/fbx2gltf

and GLTF-Transform: https://gltf-transform.dev/

About

A Simple NodeJS App to Batch Convert FBX Files to GLB and Fast Optimization

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors