Configuration Files¶
TraitBlender config files are YAML files that store the settings you see in the Configuration panel (camera, lighting, world, materials, output, etc.). You can export a YAML to reuse the same setup later.
Basic structure
Config files are organized into top-level sections. Each section controls one part of the scene or pipeline:
morphospace– which morphospace is active and its hyperparametersdataset– the external dataset file path (CSV/TSV/XLSX)world– background color and strengthcamera– position, rotation, resolution, lenslamp– light position, color, power, shadowsmat– specimen mat position, scale, color, roughnessrender– render engine and Eevee ray tracingoutput– where simulation results are written and in what formatmetadata– stamp text in the rendered imagesruler– ruler location / visibilitytransforms– optional random variation on config valuesimaging– which orientations to render, custom Euler orientations, and how many imagesmeshes– mesh export options during simulation
The Datasets panel sample controls (specimen location / rotation) are UI-only. A bare sample: key in YAML is ignored on load and is not written on export. See Unit Tests to verify a loaded file against the live scene.
Allowed values and ranges (quick reference)
world
color: 4 floats (RGBA), each in 0.0–1.0strength: float, ≥ 0.0
dataset
filepath: string path to a CSV/TSV/XLSX dataset file
camera
location,rotation: 3 floats eachcamera_type:PERSP|ORTHO|PANOfocal_length: float, ≥ 0.0resolution_x,resolution_y: integersresolution_percentage: integer in 0–100aspect_x,aspect_y: floatsshift_x,shift_y: floatslens_unit:MILLIMETERS|FOV
lamp
location,rotation,scale: 3 floats eachcolor: 3 floats (RGB), each in 0.0–1.0power: float, ≥ 0.0use_soft_falloff,shadow: booleansbeam_size: float in 0.0–10.0beam_blend: float, ≥ 0.0diffuse: float, ≥ 0.0
mat
tb_location,tb_rotation,scale: 3 floats eachcolor: 4 floats (RGBA), each in 0.0–1.0roughness: float in 0.0–1.0
render
engine:CYCLES| Eevee (BLENDER_EEVEE/BLENDER_EEVEE_NEXT; both accepted) |BLENDER_WORKBENCHcycles(used whenengineisCYCLES; written on export only for Cycles):use_adaptive_sampling,adaptive_threshold,samples,adaptive_min_samples,time_limit,use_denoising— final render samplinguse_preview_adaptive_sampling,preview_adaptive_threshold,preview_samples,preview_adaptive_min_samples,use_preview_denoising— viewport sampling
eevee(used when engine is Eevee; written on export only for Eevee):use_raytracing: booleantaa_render_samples: integer (Samples)
- Legacy flat
eevee_use_raytracingis still accepted on load
output
rendering_directory,output_directory: directory paths (strings)output_type:image|videoimage_format:PNG|JPEGimages_per_view: integer, ≥ 1
metadata
- All
use_stamp_*: booleans stamp_note_text: string
ruler
tb_location,tb_rotation: 3 floats eachhide: boolean
imaging
include_images: booleanorientation_names: list of strings (built-in and/or custom orientation names to include in the pipeline)custom_orientations: optional map of name →[rx, ry, rz]Euler angles in radians. Each custom orientation runs the morphospace Default, then applies the Euler in the specimen's local frame (relative to the post-Default pose, before bake), then recenters at geometry bounds. Available for all morphospaces. Names must be unique identifiers (letters, digits,_,-only) and must not collide with built-ins or other customs; invalid YAML entries are skipped on load.images_per_orientation: integer, ≥ 1
meshes
save_meshes: booleanorient_before_export: boolean (defaulttrue). When saving meshes in the imaging pipeline, apply the morphospace Default orientation before export. Set tofalseto export the generated mesh as-is (recommended for MorphoWeave, where the SSM already provides a consistent PCA-aligned frame). Imaging orientations are still applied afterward for renders.file_export_type:objorply
morphospace
name: morphospace display name (e.g.Shell (Default))hyperparams: mapping of morphospace-specific keys to values (keys differ by morphospace)
transforms
sampler_name: currentlynormalparams.mu: floatparams.sigma: float (use > 0 for meaningful variation)
property_path: supported scalar paths such as:world.color.r|g|b|a,world.strengthcamera.location.x|y|z,camera.rotation.x|y|zcamera.focal_length,camera.shift_x,camera.shift_ylamp.location.x|y|z,lamp.rotation.x|y|zlamp.color.r|g|b,lamp.powermat.tb_location.x|y|z,mat.tb_rotation.x|y|zmat.color.r|g|b|a,mat.roughnesssample.tb_location.x|y|z,sample.tb_rotation.x|y|z
Example 1: Minimal “museum image” config
This is a good starting point if you want a stable, repeatable setup with no augmentation.morphospace:
name: Shell (Default)
hyperparams: {}
world:
color: [0.0, 0.0, 0.0, 1.0]
strength: 1.0
camera:
location: [0.0, 0.0, 1.0]
rotation: [0.0, 0.0, 0.0]
camera_type: PERSP
focal_length: 60.0
resolution_x: 1920
resolution_y: 1920
resolution_percentage: 100
aspect_x: 1.0
aspect_y: 1.0
shift_x: 0.0
shift_y: 0.0
lens_unit: MILLIMETERS
lamp:
location: [0.0, 0.0, 1.0]
rotation: [0.0, 0.0, 0.0]
scale: [1.0, 1.0, 1.0]
color: [1.0, 1.0, 1.0]
power: 10.0
use_soft_falloff: true
beam_size: 1.0
beam_blend: 0.0
shadow: true
diffuse: 1.0
mat:
tb_location: [0.0, 0.0, 0.59]
tb_rotation: [0.0, 0.0, 0.0]
scale: [0.125, 0.125, 1.0]
color: [0.0, 0.0, 0.0, 1.0]
roughness: 1.0
render:
engine: BLENDER_EEVEE # or CYCLES / BLENDER_EEVEE_NEXT
eevee:
use_raytracing: false
taa_render_samples: 64
# When using Cycles, use a cycles: block instead, for example:
# engine: CYCLES
# cycles:
# use_adaptive_sampling: true
# adaptive_threshold: 0.01
# samples: 4096
# adaptive_min_samples: 0
# time_limit: 0.0
output:
rendering_directory: "" # The directory where simulation output will be written
output_type: image
image_format: PNG
output_directory: ""
images_per_view: 1
metadata:
use_stamp_date: true
use_stamp_time: true
use_stamp_render_time: true
use_stamp_frame: true
use_stamp_frame_range: false
use_stamp_memory: false
use_stamp_hostname: false
use_stamp_camera: true
use_stamp_lens: false
use_stamp_scene: true
use_stamp_marker: false
use_stamp_filename: true
use_stamp_sequencer_strip: false
use_stamp_note: false
stamp_note_text: ""
ruler:
tb_location: [0.0, -0.1, 0.0]
tb_rotation: [0.0, 0.0, 0.0]
hide: false
transforms: []
imaging:
include_images: true
orientation_names: []
images_per_orientation: 1
# Optional named Euler orientations (radians), usable by any morphospace:
# custom_orientations:
# Side: [1.5708, 0.0, 0.0]
# Dorsal: [0.0, 1.5708, 0.0]
meshes:
file_export_type: obj
save_meshes: false
orient_before_export: true
Example 2: Simulation that saves meshes (and skips images)
If you only want meshes during simulation (no rendered images), these are the important toggles:Example 3: Morphospace hyperparameters (non-empty)
Hyperparameters are **morphospace-specific** (they are not part of the dataset). Here is a real example for **Shell (Default)**:Example 4: Transforms (non-empty)
Transforms apply **random variation** during rendering/simulation. Each transform has: - `property_path`: which setting to change - `sampler_name`: how to sample the change - `params`: parameters for the samplerExample 5: Modern “Circle Grid + CYCLES” config
This example shows a modern YAML config structure you can load via `Configure Scene`. Sections omitted from the YAML fall back to the current Blender default values for those settings. It renders the `Circle Grid` morphospace using `CYCLES`, with transforms empty.morphospace:
name: Circle Grid
hyperparams:
{}
dataset:
filepath: "/home/calebc22/projects/tbd/datasets/circle_grid_50sp_32tr_mu5sd1.csv"
world:
color: [1.0, 1.0, 1.0, 1.0]
strength: 1.0
camera:
location: [0.0, 0.0, 1.1]
aspect_x: 1.0
aspect_y: 1.0
camera_type: PERSP
focal_length: 60.0
lens_unit: MILLIMETERS
resolution_percentage: 100
resolution_x: 220
resolution_y: 220
rotation: [0.0, 0.0, 0.0]
shift_x: 0.0
shift_y: 0.0
lamp:
location: [0.0, 0.0, 1.0]
beam_blend: 0.0
beam_size: 1.0
color: [1.0, 1.0, 1.0]
diffuse: 1.0
power: 0.0
rotation: [0.0, 0.0, 0.0]
scale: [1.0, 1.0, 1.0]
shadow: true
use_soft_falloff: true
ruler:
tb_location: [0.0, -0.1, 0.0]
tb_rotation: [0.0, 0.0, 0.0]
hide: true
mat:
color: [0.0, 0.0, 0.0, 1.0]
tb_location: [0.0, 0.0, 0.0]
tb_rotation: [0.0, 0.0, 0.0]
roughness: 1.0
scale: [0.15, 0.15, 1.0]
render:
engine: CYCLES
cycles:
use_adaptive_sampling: true
adaptive_threshold: 0.01
samples: 4096
adaptive_min_samples: 0
time_limit: 0.0
output:
image_format: PNG
images_per_view: 1
rendering_directory: "/home/calebc22/projects/tbd/simulations/shell_test_1"
output_type: image
imaging:
include_images: true
orientation_names: ['Default', 'Side']
custom_orientations:
Side: [1.5708, 0.0, 0.0]
images_per_orientation: 1
metadata:
stamp_note_text: ""
use_stamp_camera: true
use_stamp_date: true
use_stamp_filename: true
use_stamp_frame: true
use_stamp_frame_range: false
use_stamp_hostname: false
use_stamp_lens: false
use_stamp_marker: false
use_stamp_memory: false
use_stamp_note: false
use_stamp_render_time: true
use_stamp_scene: true
use_stamp_sequencer_strip: false
use_stamp_time: true
transforms: []
Using config files¶
- Export a YAML from the GUI (Export Config as YAML), or edit one by hand using the schema above.
- In Museum Setup, set Config File (or leave it empty and pick a file when prompted) and click Configure Scene.
- After a successful load, the chosen path is stored on
traitblender_setup.config_fileso the field and unit tests stay in sync.
Custom orientations in YAML¶
Under imaging.custom_orientations, map a unique name to Euler angles [rx, ry, rz] in radians. Built-in morphospace orientation names always win on collision. Customs are available for every morphospace: they run Default, apply the Euler in the specimen’s local frame (relative to the post-Default pose, before bake), then recenter at geometry bounds. List those names in orientation_names to include them in the imaging pipeline.
Names must be simple identifiers: letters, digits, underscores, and hyphens only (e.g. Side, Left-view). Spaces, quotes, and other special characters are rejected in the UI, and names must not collide with another custom or a built-in orientation. Invalid entries in YAML are skipped on load.
Mesh export in the imaging pipeline¶
When meshes.save_meshes is true, the simulation pipeline writes one mesh per specimen under rendering_directory/meshes/<specimen>/ before imaging orientations and transform randomization run for that specimen’s renders.
meshes.orient_before_export (default true) controls the pose of that file:
| Value | Mesh file contents |
|---|---|
true (default) |
Morphospace Default applied first (table placement). Same behavior as earlier TraitBlender releases. |
false |
Export the mesh as generated, with no Default/table orientation. Prefer this for MorphoWeave, where the SSM already lives in a shared PCA-aligned frame. Imaging orientations still apply afterward for rendered images only. |
Verifying a load¶
After Configure Scene, run config_matches_scene (see Unit Tests) to confirm the YAML still matches the live scene—including Cycles/Eevee render vs viewport sampling keys.