goo.simulator¶
- class goo.simulator.Simulator(celltypes: List[CellType | Cell] = [], diffsystems: DiffusionSystem = [], time: int = 250, physics_dt: int = 1, molecular_dt: int = 1)[source]¶
Bases:
object
A simulator for cell-based simulations in Blender.
- Parameters:
cells (List[Cell]) – List of cells.
time (List[int]) – Start and end frames.
physics_dt (int) – Time step for physics simulation.
molecular_dt (int) – Time step for molecular simulation.
diffsystems (DiffusionSystem)
- add_handler(handler: Handler, celltypes: list[CellType] | None = None, diffsystem: DiffusionSystem | None = None)[source]¶
Add a handler to the simulation.
- Parameters:
handler (Handler)
celltypes (list[CellType] | None)
diffsystem (DiffusionSystem | None)
- add_handlers(handlers: list[Handler])[source]¶
Add multiple handlers to the simulation.
- Parameters:
handlers (list[Handler])
- render(frames: List[int] | range | None = None, path: str | None = 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)
- render_animation(path=None, end=bpy.context.scene.frame_end, camera=False)[source]¶
Render the simulation as an animation.