stage_bake_simulation
Converts physics simulation data into keyframe animations for export to React Three Fiber or Remotion, enabling physics-driven video rendering.
Instructions
Bake physics simulation to keyframe animations.
Converts physics simulation data into keyframes that can be
exported to R3F/Remotion for video rendering.
Args:
scene_id: Scene identifier
simulation_id: Physics simulation ID from chuk-mcp-physics
fps: Frames per second for sampling (default 60)
duration: Duration in seconds to bake (if None, bakes entire simulation)
physics_server_url: Optional Rapier HTTP server URL
If None, defaults to public Rapier service (https://rapier.chukai.io)
Can be overridden with RAPIER_SERVICE_URL environment variable
Returns:
BakeSimulationResponse with frame count and baked object list
Tips for LLMs:
- Run physics simulation first (chuk-mcp-physics step_simulation or record_trajectory)
- Bind objects to physics bodies (stage_bind_physics)
- Bake simulation to convert physics → animation keyframes
- Then export scene to R3F/Remotion with animation data
Example:
# After running simulation and binding objects
result = await stage_bake_simulation(
scene_id=scene_id,
simulation_id=sim.sim_id,
fps=60,
duration=10.0
)
print(f"Baked {result.total_frames} frames for {len(result.baked_objects)} objects")Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| scene_id | Yes | ||
| simulation_id | Yes | ||
| fps | No | ||
| duration | No | ||
| physics_server_url | No |