Skip to main content
Glama
ujs204

BlenderMCP

by ujs204

download_polyhaven_asset

Download Polyhaven assets directly into Blender by specifying asset ID, type, resolution, and file format using the BlenderMCP server.

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
NameRequiredDescriptionDefault
asset_idYes
asset_typeYes
file_formatNo
resolutionNo1k

Implementation Reference

  • The primary handler function for the 'download_polyhaven_asset' MCP tool. It is registered via @mcp.tool() decorator, defines the input schema through parameters and docstring, proxies the download request to the Blender instance, and provides formatted success/error responses with asset-type specific details.
    @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)}"
  • Input schema and documentation for the tool parameters and return value.
    """ 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.
  • Helper documentation in the asset_creation_strategy prompt that describes usage of the tool for different asset types.
    - For objects/models: Use download_polyhaven_asset() with asset_type="models" - For materials/textures: Use download_polyhaven_asset() with asset_type="textures" - For environment lighting: Use download_polyhaven_asset() with asset_type="hdris"

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/ujs204/CLAUDE-BLENDER-MCP'

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