Blendmentation¶
Generate synthetic, augmented training datasets from Blender scenes. You describe your dataset as composed steps, in the style of torchvision / albumentations:
- Augment: randomize objects, materials and any other value in the scene.
- Generate: render the image, render passes, shader AOVs and segmentation masks, and write a JSON label with bounding boxes, keypoints, camera data, rotations and any values you want to record.
- Restore: put the scene back as it was, and repeat.
- Export: convert the dataset to COCO, YOLO, Pascal VOC or BOP (6D pose).
Approach¶
Blendmentation automates and augments ordinary Blender scenes, built with the workflows
you already use. Instead of a custom function for every use case, the variation in your
synthetic data generation (SDG) pipeline lives in Blender itself, in shader nodes and
geometry nodes. Blendmentation randomizes it by changing their values (Number,
Vector, Boolean, Menu, Node, Seed), so whatever you can build with nodes, you can
augment.
A few augmentations are shortcuts for common setups, so a basic pipeline is quick and
easy to get going: KeepAbove, PlaceOn, LookAt, PlaceOnCurve, SimpleMaterial, FocalLength and
DepthOfField. The transforms (Translation, Rotation, Scale) are there for simple
scenes, and for small changes outside of a geometry nodes setup. For cluttered scenes,
we recommend placing the objects with geometry nodes instead.
The generating step is different. Apart from the color render, producing training data (masks, bounding boxes, poses, labels) is not part of the usual Blender workflow, so Blendmentation does it itself.
Requirements¶
- Blender 4.2 LTS or newer. It is tested on 4.2, 4.5 and 5.2.
- Nothing else. The code runs in Blender's bundled Python, and uses
numpyandOpenImageIO, which ship with Blender.
Quick start¶
A scene with two cars, "Car.001" and "Car.002", using the material "CarPaint":
import bpy
from blendmentation import augmentations as aug
from blendmentation import export
from blendmentation import generating as gen
from blendmentation import state
cars = [bpy.data.objects["Car.001"], bpy.data.objects["Car.002"]]
classes = {"car": cars}
# 1. augment
objects_aug = aug.Compose([
aug.Translation(x=0.5, y=0.5),
aug.Rotation(z=180),
aug.SimpleMaterial("CarPaint", hue=(0, 1)),
])
# 2. what to save for every datapoint
generator = gen.Compose([
gen.Render(),
gen.BBox(classes),
gen.Segmentation(classes),
], path="//dataset", resolution=(640, 480))
for _ in range(1000):
# 3. everything changed inside is set back afterwards
with state.restoring():
objects_aug(cars)
generator()
# 4. training-ready annotations
export.coco("//dataset")
More examples, built up step by step, are in the Quick start.
Next steps¶
- Quick start: examples built up step by step, and a full example with every feature.
- Installation: inside Blender (as an add-on, or from a copy), or as a Python module.
- Augmentations, State, Generating and Export: the reference for each module, with examples.
- Compatibility with Blender MCP: an agent skill so AI agents can build datasets in your open Blender through Blender MCP.