A collection of Python scripts for automating rendering in Blender, with a focus on generating synthetic training data with randomized parameters.
- Automatic rendering with randomized parameters
- GPU-accelerated rendering using Cycles engine
- Random background image loading
- Camera position randomization
- Material and lighting adjustments
- Optional occlusion generation
- High-quality output configuration
- Blender 3.x
- Python 3.x
- Required Python packages:
fake-bpy-module-latest==20251003
- Install Blender on your system
- Create a Python virtual environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
- Install requirements:
pip install -r requirements.txt
-
Open your 3D model in Blender
-
Ensure your model has at least one material assigned
-
Configure the script parameters in
auto_render.py:SAMPLES_NUMBER: Number of renders to generateX_RES,Y_RES: Output resolutionIS_OCLUSSION_ENABLE: Toggle occlusion generation
-
Run the script in Blender's Python console or via command line:
blender your_model.blend --python auto_render.py
- Default render settings:
- Resolution: 640x480
- Samples: 128
- Color profile: AgX - High Contrast
- Engine: Cycles (GPU)
Rendered images will be saved to the specified output directory with the following naming convention:
D{model_name}-{index}-v7.png
This project is open-source. Feel free to use and modify as needed.