assimp
Convert various 3D model formats
TLDR
List all supported import formats
List all supported export formats
Convert a file to one of the supported output formats, using the default parameters
Convert a file using custom parameters (the dox_cmd.h file in assimp's source code lists available parameters)
Display a summary of a 3D file's contents
Display help
Display help for a specific subcommand
SYNOPSIS
assimp command [options] input_file [output_file]
Common commands and their usage:assimp info [options] input_file
assimp export [options] input_file output_file
PARAMETERS
--help
, -h
Displays the help message for the command or subcommand.--input <file>
, -i <file>
Specifies the path to the input 3D model file.--output <file>
, -o <file>
Specifies the path for the output 3D model file (used with export
command).--format <id>
, -f <id>
Sets the target output format ID for export (e.g., obj
, fbx
, gltf2
).--postprocess <flag>
, -p <flag>
Applies a specific post-processing flag to the imported scene. Can be specified multiple times. Examples include Triangulate
, GenNormals
, FlipUVs
, OptimizeMeshes
.--verbose
, -v
Enables verbose logging output during processing.--stats
, -s
Displays detailed statistics about the imported scene (used with info
command).--log-level <level>
Sets the logging verbosity level (e.g., debug, info, warn, error).--clean-scene
Cleans the scene after import, removing unused data or nodes.--validate
Performs validation checks on the loaded scene data.
DESCRIPTION
The assimp command is the command-line utility for the Open Asset Import Library (Assimp). It provides powerful capabilities for converting 3D models between a vast array of formats, as well as inspecting their properties. Supporting over 50 input formats (including OBJ, FBX, glTF, DAE, 3DS, STL) and numerous output formats, assimp is a versatile tool for asset pipeline management.
Beyond simple format conversion, assimp can apply a wide range of post-processing steps to models, such as triangulation, normal generation, UV coordinate transformations, and scene optimization. These features are crucial for preparing 3D assets for rendering, game engines, or other applications, ensuring compatibility and visual fidelity.
CAVEATS
The exact set of supported input/output formats and post-processing flags can vary based on how the assimp command-line tool was compiled and distributed. It is always recommended to consult the output of assimp export --help
or assimp info --help
on your specific system to see the available options. Applying incorrect or inappropriate post-processing flags can lead to unintended visual artifacts or corrupted models. Large models can consume significant memory during conversion.
SUPPORTED FORMATS
Assimp boasts an extensive list of supported 3D model formats for both import and export. Commonly supported formats include:
Import: COLLADA (.dae), FBX (.fbx), glTF (.gltf, .glb), Wavefront OBJ (.obj), 3DS (.3ds), STL (.stl), PLY (.ply), X (.x), Blender 3D (.blend), and many more.
Export: OBJ, glTF2, FBX, STL, PLY, 3MF, X, Collada, among others.
The full list of supported formats can be found in the assimp export --help
output or the official Assimp documentation.
POST-PROCESSING FLAGS EXPLAINED
Post-processing flags (specified with -p
or --postprocess
) are vital for optimizing and correcting 3D models. Some of the most frequently used flags include:
Triangulate
: Converts all polygonal faces to triangles, which is standard for most rendering pipelines.GenNormals
: Generates smooth vertex normals if they are missing or incorrect, crucial for proper lighting.FlipUVs
: Flips UV coordinates vertically, often necessary when converting between applications that use different UV origins (e.g., OpenGL vs. DirectX).OptimizeMeshes
: Attempts to reduce the number of meshes and draw calls by combining adjacent meshes.JoinIdenticalVertices
: Merges duplicate vertices that have the same position, normal, and texture coordinates.
aiProcess_
constants in the Assimp library API.
HISTORY
The Open Asset Import Library (Assimp) was initiated around 2008 by Kim Kulling with the goal of providing a comprehensive, easy-to-use, and robust library for importing various 3D asset formats into applications. It quickly gained traction, particularly in the game development and real-time rendering communities, due to its broad format support and advanced post-processing capabilities. The assimp command-line utility was developed as a direct tool to showcase and utilize the core functionalities of the library, allowing users to perform common conversions and inspections without writing code, thus becoming an integral part of many 3D asset pipelines.