render_preview
Generate a base64-encoded preview image from the current Cinema 4D view, with optional width, height, and frame parameters for scene visualization.
Instructions
Render the current view and return a base64-encoded preview image.
Args:
width: Optional preview width in pixels
height: Optional preview height in pixels
frame: Optional frame number to renderInput Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| width | No | ||
| height | No | ||
| frame | No |
Implementation Reference
- src/cinema4d_mcp/server.py:1131-1168 (handler)The handler function that implements the render_preview tool logic.
async def render_preview( width: Optional[int] = None, height: Optional[int] = None, frame: Optional[int] = None, ctx: Context = None, ) -> str: """ Render the current view and return a base64-encoded preview image. Args: width: Optional preview width in pixels height: Optional preview height in pixels frame: Optional frame number to render """ async with c4d_connection_context() as connection: if not connection.connected: return "❌ Not connected to Cinema 4D" # Prepare command command = {"command": "render_preview"} if width: command["width"] = width if height: command["height"] = height if frame is not None: command["frame"] = frame # Set longer timeout for rendering logger.info(f"Sending render_preview command with parameters: {command}") # Send command to Cinema 4D response = send_to_c4d(connection, command) if "error" in response: return f"❌ Error: {response['error']}" return format_c4d_response(response, "render_preview") - src/cinema4d_mcp/server.py:1130-1130 (registration)The decorator that registers render_preview as an MCP tool.
@mcp.tool()