get_polyhaven_status
Check if PolyHaven asset integration is enabled in Blender to verify availability of HDRI, texture, and 3D model features.
Instructions
Check if PolyHaven integration is enabled in Blender. Returns a message indicating whether PolyHaven features are available.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/blender_mcp/server.py:526-542 (handler)The core handler function for the 'get_polyhaven_status' tool, decorated with @mcp.tool() for registration. It sends a command to Blender to check if PolyHaven integration is enabled and returns a status message.@mcp.tool() def get_polyhaven_status(ctx: Context) -> str: """ Check if PolyHaven integration is enabled in Blender. Returns a message indicating whether PolyHaven features are available. """ try: blender = get_blender_connection() result = blender.send_command("get_polyhaven_status") enabled = result.get("enabled", False) message = result.get("message", "") if enabled: message += "PolyHaven is good at Textures, and has a wider variety of textures than Sketchfab." return message except Exception as e: logger.error(f"Error checking PolyHaven status: {str(e)}") return f"Error checking PolyHaven status: {str(e)}"
- src/blender_mcp/server.py:216-220 (helper)Helper code in get_blender_connection() that uses the 'get_polyhaven_status' command to verify the Blender connection is alive and caches the PolyHaven enabled status globally.# First check if PolyHaven is enabled by sending a ping command result = _blender_connection.send_command("get_polyhaven_status") # Store the PolyHaven status globally _polyhaven_enabled = result.get("enabled", False) return _blender_connection
- src/blender_mcp/server.py:207-219 (helper)Global variable to cache PolyHaven status, set using the tool's command._polyhaven_enabled = False # Add this global variable def get_blender_connection(): """Get or create a persistent Blender connection""" global _blender_connection, _polyhaven_enabled # Add _polyhaven_enabled to globals # If we have an existing connection, check if it's still valid if _blender_connection is not None: try: # First check if PolyHaven is enabled by sending a ping command result = _blender_connection.send_command("get_polyhaven_status") # Store the PolyHaven status globally _polyhaven_enabled = result.get("enabled", False)
- src/blender_mcp/server.py:887-887 (helper)Reference to the tool in the asset_creation_strategy prompt docstring, instructing to use it to check status.Use get_polyhaven_status() to verify its status