Skip to main content
Glama

set_texture

Apply Polyhaven textures to 3D objects in Blender by specifying the object name and texture ID to enhance visual appearance.

Instructions

Apply a previously downloaded Polyhaven texture to an object.

Parameters:

  • object_name: Name of the object to apply the texture to

  • texture_id: ID of the Polyhaven texture to apply (must be downloaded first)

Returns a message indicating success or failure.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
object_nameYes
texture_idYes

Implementation Reference

  • The `set_texture` tool handler which sends the command to the Blender instance.
    @mcp.tool()
    def set_texture(
        ctx: Context,
        object_name: str,
        texture_id: str
    ) -> str:
        """
        Apply a previously downloaded Polyhaven texture to an object.
        
        Parameters:
        - object_name: Name of the object to apply the texture to
        - texture_id: ID of the Polyhaven texture to apply (must be downloaded first)
        
        Returns a message indicating success or failure.
        """
        try:
            # Get the global connection
            blender = get_blender_connection()
            result = blender.send_command("set_texture", {
                "object_name": object_name,
                "texture_id": texture_id
            })
            
            if "error" in result:
                return f"Error: {result['error']}"
            
            if result.get("success"):
                material_name = result.get("material", "")
                maps = ", ".join(result.get("maps", []))
                
                # Add detailed material info
                material_info = result.get("material_info", {})

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/iflow-mcp/Eminemminem-blender-mcp'

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