#vtk #obj #3d #animation #generator

bin+lib gltfgen

Command line tool for generating glTF 2.0 animations from numbered sequences of mesh files

13 unstable releases (5 breaking)

0.8.0 Nov 19, 2023
0.6.1 Jun 8, 2022
0.5.0 Feb 9, 2021
0.4.5 May 12, 2020
0.4.1 Dec 23, 2019

#80 in Graphics APIs

Download history 55/week @ 2023-11-03 3/week @ 2023-11-10 28/week @ 2023-11-17 34/week @ 2023-11-24 53/week @ 2023-12-01 5/week @ 2023-12-08 16/week @ 2023-12-15 27/week @ 2023-12-22 1/week @ 2023-12-29 15/week @ 2024-01-05 22/week @ 2024-01-19 23/week @ 2024-01-26 26/week @ 2024-02-02 32/week @ 2024-02-09 203/week @ 2024-02-16

284 downloads per month

MPL-2.0 license



A command line tool for generating glTF 2.0 animations from numbered sequences of mesh files.

On crates.io GHA Build status


The latest gltfgen builds are available via

> cargo install gltfgen

For special builds see Releases.

The following is the most basic usage pattern:

  • <OUTPUT> Output glTF file

  • <PATTERN> A glob pattern matching files to be included in the generated glTF document. Use # to match a frame number. Use '{' and '}' to select parts of the pattern to be used to name meshes in the output glTF.

Run gltfgen -h for more options and gltfgen --help for full details.


The following example assumes that there is a sequence of meshes located at ./meshes/animation_#.vtk where # represents the frame number. To generate an animated binary glTF file named output.glb in the current directory, run:

> gltfgen output.glb "./meshes/animation_#.vtk"

This will assume 24 frames per second (FPS). You can specify FPS manually with the -f option as follows:

> gltfgen -f 100 output.glb "./meshes/animation_#.vtk"

Alternatively, to specify a time step like 0.01 seconds between frames, use the -t option:

> gltfgen -t 0.01 output.glb "./meshes/animation_#.vtk"


Input Types

  • Legacy and XML VTK polygon and tetrahedral meshes in double or float format. In particular unstructured grids and polygon VTK formats are supported. Tetrahedral VTK meshes are converted to triangle meshes on the fly.
  • Basic wavefront obj files containing polygon meshes (no .mtl support yet).
  • JPEG and PNG image textures are supported.

Output Types

  • glTF 2.0 in binary and standard formats.

Other Features

  • Multiple mesh file sequences can be embedded into a single glTF file automatically.
  • Non-numbered mesh files will be placed at frame 0 if captured by the glob pattern.
  • Skip frames with -s flag to reduce file size and improve performance.
  • Images textures can be referenced or embedded directly into the glTF file.
  • Full support for
    • color attributes,
    • texture attributes,
    • custom attributes,
  • Full support for textures.
  • Material attribute on VTK primitives is used to reference specific materials provided on the command line.


Please see CHANGELOG.md for updates.


This repository is licensed under the Mozilla Public License, v. 2.0.


See CONTRIBUTING.md for details.


~407K SLoC