ufbx/ufbx logo

ufbx/ufbx

Free

Single source file FBX loader

FreeFree tier
Type
Open Source

About ufbx/ufbx

ufbx is a single source file (ufbx.c) and header (ufbx.h) library for loading FBX files. It supports binary and ASCII FBX files starting from version 3000. The library is designed to be safe and robust, gracefully handling invalid files and out-of-memory conditions. Loaded scenes are sanitized to avoid out-of-bounds indices or non-UTF-8 strings. It supports a wide range of object types including meshes, skinning, blend shapes, lights, cameras, embedded textures, NURBS curves and surfaces, geometry caches, LOD groups, display/selection sets, rigging constraints, and unified PBR material from known vendor-specific materials. The library also provides utilities such as polygon triangulation, index generation, animation curve evaluation, CPU skinning evaluation, subdivision surface evaluation, NURBS curve/surface tessellation, progress reporting, and cancellation. Additionally, it supports loading Wavefront .obj files. ufbx is written in portable C (also compiles as C++) and has been extensively tested on multiple platforms (Windows, macOS, Linux, WASI) with bit-exact results. It achieves 95% branch line coverage and is fuzzed for security.

Key Features

Supports binary and ASCII FBX files from version 3000
Safe handling of invalid files and out-of-memory conditions
Wide range of object types: meshes, skinning, blend shapes, lights, cameras, embedded textures, NURBS, geometry caches, LOD groups, constraints, PBR materials
Utilities for scene evaluation: polygon triangulation, index generation, animation curve evaluation, CPU skinning, subdivision surface, NURBS tessellation, progress reporting, cancellation
Support for Wavefront .obj files
Single-file integration (ufbx.c and ufbx.h), compiled as C99/C++11 or later
Portable C/C++ with tested bit-exact results on Windows, macOS, Linux, WASI
High code coverage (95% branch line) and multi-layer fuzzing

Pros & Cons

Pros
  • Free and open source
  • Single-file integration simplifies project setup
  • Comprehensive FBX feature support, including legacy formats
  • Robust error handling and sanitization for malformed files
  • Extensively tested across multiple platforms with bit-exact results
  • Also supports Wavefront OBJ files
Cons
  • Only supports FBX and OBJ file formats (no glTF, Collada, etc.)
  • Requires manual compilation as C99/C++11 or later
  • No graphical user interface or high-level scripting interface
  • Documentation primarily in header comments and README

Best For

Loading FBX files in game engines and 3D applicationsImporting FBX scenes for conversion to other formatsInspecting scene hierarchy and object propertiesEmbedding FBX support in tools that require 3D file loading

FAQ

What FBX versions does ufbx support?
ufbx supports binary and ASCII FBX files starting from version 3000.
How do I integrate ufbx into my project?
Copy ufbx.h and ufbx.c into your project and compile ufbx.c as C99/C++11 or more recent. Optionally add misc/ufbx.natvis for debug formatting.
Does ufbx support .obj files?
Yes, ufbx includes support for loading Wavefront .obj files as well.
Is ufbx safe to use with untrusted files?
Yes, ufbx handles invalid files and out-of-memory conditions gracefully. Loaded scenes are sanitized to avoid out-of-bounds indices or non-UTF-8 strings.