get_viewport_screenshot
Capture screenshots of the Blender 3D viewport for documentation, progress tracking, or sharing visual updates during modeling workflows.
Instructions
Capture a screenshot of the current Blender 3D viewport.
Parameters:
max_size: Maximum size in pixels for the largest dimension (default: 800)
Returns the screenshot as an Image.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| max_size | No |
Implementation Reference
- src/blender_mcp/server.py:221-249 (handler)The 'get_viewport_screenshot' tool handler, which captures a screenshot from the Blender viewport by sending a command to the Blender addon and decoding the returned base64 image data.
def get_viewport_screenshot(ctx: Context, max_size: int = 800) -> Image: """ Capture a screenshot of the current Blender 3D viewport. Parameters: - max_size: Maximum size in pixels for the largest dimension (default: 800) Returns the screenshot as an Image. """ try: blender = get_blender_connection() result = blender.send_command("get_viewport_screenshot", { "max_size": max_size, "format": "png" }) if "error" in result: raise Exception(result["error"]) # Decode base64 image data received from addon image_bytes = base64.b64decode(result["image_data"]) img_format = result.get("format", "png") return Image(data=image_bytes, format=img_format) except Exception as e: logger.error(f"Error capturing screenshot: {str(e)}") raise Exception(f"Screenshot failed: {str(e)}")