Skip to content

API Reference

This reference focuses on the user-facing operators and properties you will use in normal TraitBlender workflows.

1. Museum Setup

bpy.ops.traitblender.setup_scene()

Load the pre-configured museum scene with the camera, lighting, and table objects needed for morphospace work.


bpy.ops.traitblender.clear_scene()

Remove the current scene contents so you can start from a clean state.

2. Configuration

bpy.context.scene.traitblender_config

The main configuration PropertyGroup containing all scene settings.


bpy.ops.traitblender.show_configuration()

Print the current configuration as YAML for inspection or copying.


bpy.ops.traitblender.export_config(filepath="")

Export the current configuration to a YAML file.

3. Morphospaces

bpy.context.scene.traitblender_setup.available_morphospaces

Select the active morphospace. Changing it can alter the available parameters, orientations, and default dataset.


bpy.context.scene.traitblender_dataset.sample

Select the current specimen or sample name from the active dataset.


bpy.ops.traitblender.generate_morphospace_sample()

Generate a morphospace sample object using the selected sample and morphospace settings.


bpy.ops.traitblender.apply_orientation()

Apply the selected morphospace orientation to the current sample.

4. Datasets

bpy.context.scene.traitblender_dataset.filepath

Path to the dataset file on disk.


bpy.ops.traitblender.import_dataset()

Import CSV, TSV, or Excel data into the in-memory dataset.


bpy.ops.traitblender.edit_dataset()

Open the dataset editor and modify the current dataset interactively.


bpy.ops.traitblender.export_dataset()

Export the current dataset to a CSV file.

5. Transforms

bpy.context.scene.traitblender_config.transforms

Transform pipeline settings and state.


bpy.ops.traitblender.run_pipeline()

Run the transform pipeline on the current specimen.


bpy.ops.traitblender.undo_pipeline()

Undo the last transform step.


bpy.ops.traitblender.reset_pipeline()

Reset the pipeline back to its initial state.

6. Meshes

bpy.context.scene.traitblender_config.meshes.file_export_type

Choose the mesh export format used by the mesh exporter and simulation pipeline.


bpy.context.scene.traitblender_config.meshes.save_meshes

If enabled, save a mesh export during simulation.


bpy.ops.traitblender.export_mesh()

Export the current sample as a mesh file using the selected format.

7. Imaging and Simulation

bpy.context.scene.traitblender_config.imaging

Controls for the imaging pipeline, including whether to render images during simulation.


bpy.context.scene.traitblender_config.output.rendering_directory

Root directory used for simulation output.


bpy.ops.traitblender.imaging_pipeline()

Run the full simulation pipeline for the current dataset.

User-facing properties

bpy.context.scene.traitblender_config

Main configuration object for all TraitBlender settings.


bpy.context.scene.traitblender_setup

Setup state for morphospace selection and scene initialization.


bpy.context.scene.traitblender_dataset

The current dataset and its editable CSV contents.


bpy.context.scene.traitblender_orientation

The currently selected orientation.


bpy.context.scene.traitblender_sample

The current sample object.

Notes

  • The Python tooltip in Blender is usually enough to discover the matching API call for a given button or property.