set_texture
Apply downloaded Polyhaven textures to objects in Blender to enhance 3D models with realistic surfaces.
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
| Name | Required | Description | Default |
|---|---|---|---|
| object_name | Yes | ||
| texture_id | Yes |
Implementation Reference
- src/blender_mcp/server.py:403-425 (handler)The set_texture tool handler, which communicates with Blender to apply a texture. It is registered with the @mcp.tool() decorator.
@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 })