goo.simulator

class goo.simulator.Render(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: Enum

MP4 = 3
PNG = 1
TIFF = 2
class goo.simulator.Simulator(celltypes: List[CellType] = [], diffsystems: List[DiffusionSystem] = [], time: int = 250, physics_dt: int = 1, molecular_dt: int = 0.1)[source]

Bases: object

A simulator for cell-based simulations in Blender.

Parameters:
  • celltypes (List[CellType]) – List of cell types.

  • time (List[int]) – Start and end frames.

  • physics_dt (int) – Time step for physics simulation.

  • molecular_dt (int) – Time step for molecular simulation.

  • diffsystems (List[DiffusionSystem])

add_celltype(celltype)[source]
add_celltypes(celltypes)[source]
add_handler(handler: Handler, celltypes: list[CellType] = None, diffsystems: list[DiffusionSystem] = None)[source]
Parameters:
add_handlers(handlers: list[Handler], celltypes: list[CellType] = None)[source]
Parameters:
enable_addon(addon)[source]
extend_scene()[source]
get_cells(celltypes=None)[source]
get_cells_func(celltypes=None)[source]
get_diffsystems_func(diffsystems=None)[source]
render(frames: List[int] | range | None = None, path: str = None, camera=False, format: Render = Render.PNG)[source]

Render the simulation in the background without updating the 3D Viewport in real time. If a camera is specified, the frames will be rendered with it, otherwise the frames will be rendered in the 3D Viewport. It will updated the scene at the end of the simulation.

Parameters:
  • start (int) – Start frame.

  • end (int) – End frame.

  • path (str) – Path to save the frames.

  • camera (bool) – Render with the camera.

  • format (Render) – Render format: PNG (default), TIFF, MP4.

  • frames (List[int] | range | None)

run(end=250)[source]

Run the simulation in the background without updating the 3D Viewport in real time.

Parameters:

end (int) – End frame.

set_seed(seed)[source]
setup_world(seed=1)[source]
toggle_gravity(on)[source]