download_polyhaven_asset
Download Poly Haven assets directly into Blender for 3D modeling projects. Specify asset type, resolution, and format to import HDRIs, textures, or models into your scene.
Instructions
Download and import a Polyhaven asset into Blender.
Parameters:
asset_id: The ID of the asset to download
asset_type: The type of asset (hdris, textures, models)
resolution: The resolution to download (e.g., 1k, 2k, 4k)
file_format: Optional file format (e.g., hdr, exr for HDRIs; jpg, png for textures; gltf, fbx for models)
Returns a message indicating success or failure.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| asset_id | Yes | ||
| asset_type | Yes | ||
| resolution | No | 1k | |
| file_format | No |
Implementation Reference
- src/blender_mcp/server.py:416-466 (handler)MCP tool handler for 'download_polyhaven_asset'. Proxies the request to the Blender addon via socket connection, handles response formatting based on asset type, and returns success/error messages.@mcp.tool() def download_polyhaven_asset( ctx: Context, asset_id: str, asset_type: str, resolution: str = "1k", file_format: str = None ) -> str: """ Download and import a Polyhaven asset into Blender. Parameters: - asset_id: The ID of the asset to download - asset_type: The type of asset (hdris, textures, models) - resolution: The resolution to download (e.g., 1k, 2k, 4k) - file_format: Optional file format (e.g., hdr, exr for HDRIs; jpg, png for textures; gltf, fbx for models) Returns a message indicating success or failure. """ try: blender = get_blender_connection() result = blender.send_command("download_polyhaven_asset", { "asset_id": asset_id, "asset_type": asset_type, "resolution": resolution, "file_format": file_format }) if "error" in result: return f"Error: {result['error']}" if result.get("success"): message = result.get("message", "Asset downloaded and imported successfully") # Add additional information based on asset type if asset_type == "hdris": return f"{message}. The HDRI has been set as the world environment." elif asset_type == "textures": material_name = result.get("material", "") maps = ", ".join(result.get("maps", [])) return f"{message}. Created material '{material_name}' with maps: {maps}." elif asset_type == "models": return f"{message}. The model has been imported into the current scene." else: return message else: return f"Failed to download asset: {result.get('message', 'Unknown error')}" except Exception as e: logger.error(f"Error downloading Polyhaven asset: {str(e)}") return f"Error downloading Polyhaven asset: {str(e)}"
- src/blender_mcp/server.py:424-433 (schema)Input schema and documentation for the download_polyhaven_asset tool, defining parameters and return type.""" Download and import a Polyhaven asset into Blender. Parameters: - asset_id: The ID of the asset to download - asset_type: The type of asset (hdris, textures, models) - resolution: The resolution to download (e.g., 1k, 2k, 4k) - file_format: Optional file format (e.g., hdr, exr for HDRIs; jpg, png for textures; gltf, fbx for models) Returns a message indicating success or failure.
- src/blender_mcp/server.py:416-416 (registration)Registration of the download_polyhaven_asset tool using the FastMCP decorator.@mcp.tool()
- src/blender_mcp/server.py:891-891 (helper)Usage guidance in the asset_creation_strategy prompt template mentioning the tool.- For environment lighting: Use download_polyhaven_asset() with asset_type="hdris"