As it states in Blender's Python API Overview
Blender has an embedded Python interpreter which is loaded when Blender is started and stays active while Blender is running.
This repository provides ability to generate synthetic datasets using ONLY Blender executable without any additional dependency.
Script was tested on
❯ blender.exe --background --python-expr "import sys; print(sys.version)"
Blender 4.2.9 LTS (hash a10f621e649a built 2025-04-15 01:46:41)
3.11.7 (main, Jun 11 2024, 12:31:01) [GCC 11.2.1 20220127 (Red Hat 11.2.1-9)]
Blender quit
See help
Blender 4.2.9 LTS (hash a10f621e649a built 2025-04-15 01:46:41)
usage: blender [-h] model_path output_directory [number_of_renders]
Script for generating rendered images of a 3D model using Blender, driven by config.toml.
positional arguments:
model_path Path to the 3D model file (OBJ, FBX, glTF, GLB).
output_directory Directory where the rendered images will be saved.
number_of_renders Number of images to generate per run.
options:
-h, --help show this help message and exit
--dump-config Dump user configuration as python dict and exit.
--skip-render Setup everything and skip render.
-
Export monkey mesh Suzanne from
blenderas.glb(or download it here) -
To generate one image into
outputdirectory useblender --background --python generate-batch.py -- suzanne.glb ./output
-
See result in
outputdirectory -
To generate 16 images from random locations into
outputdirectory useblender --background --python generate-batch.py -- suzanne.glb ./output 16
-
See result in
outputdirectory1
Script provides extensive configuration via user defined config.toml, see config.default.toml for available parameters.
To dump parsed config and exit the program use
blender --background --python generate-batch.py -- --dump-configThis project ships with a config‑driven plugin system that lets you bolt new functionality onto the rendering pipeline without touching the main script.
See available plugins and more in PLUGINS.md.
The compat/ directory contains helper scripts to restructure the output of this Blender dataset generator into formats compatible with popular neural rendering and 3D reconstruction frameworks:
- COLMAP - Converts to standard COLMAP structure (images/, sparse/)
python compat/to_colmap/to_colmap.py <input_dir> <output_dir>
- NSVF - Prepares data for Neural Sparse Voxel Fields pipeline
python compat/to_nsvf_dataset/to_nsvf_dataset.py <input_dir> <output_dir>
- IDR - Formats data for Implicit Differentiable Renderer requirements
python compat/to_idr_dataset/to_idr_dataset.py <input_dir> <output_dir>
See FAQ.md


