Skip to main content
Glama
opslon

BlenderMCP

by opslon

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
NameRequiredDescriptionDefault
max_sizeNo

Implementation Reference

  • 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)}")

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/opslon/blender-mcp-optimized'

If you have feedback or need assistance with the MCP directory API, please join our Discord server