render_frame
Render the current frame in Cinema 4D with customizable output path and dimensions for 3D scene visualization.
Instructions
Render the current frame.
Args:
output_path: Optional path to save the rendered image
width: Optional render width in pixels
height: Optional render height in pixelsInput Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| output_path | No | ||
| width | No | ||
| height | No |
Implementation Reference
- src/cinema4d_mcp/server.py:636-666 (handler)The 'render_frame' tool is defined as an async function decorated with @mcp.tool(). It validates connection to Cinema 4D, prepares a command dictionary, and sends it via 'send_to_c4d'.
async def render_frame( output_path: Optional[str] = None, width: Optional[int] = None, height: Optional[int] = None, ctx: Context = None, ) -> str: """ Render the current frame. Args: output_path: Optional path to save the rendered image width: Optional render width in pixels height: Optional render height in pixels """ async with c4d_connection_context() as connection: if not connection.connected: return "❌ Not connected to Cinema 4D" # Prepare command command = {"command": "render_frame"} if output_path: command["output_path"] = output_path if width: command["width"] = width if height: command["height"] = height # Send command to Cinema 4D response = send_to_c4d(connection, command) return format_c4d_response(response, "render_frame")