Skip to main content
Glama

set_material

Apply or create materials for 3D objects using specified colors and names, integrating with Tripo AI's Model Context Protocol for Blender workflows.

Instructions

Set or create a material for an object. Parameters: - object_name: Name of the object to apply the material to - material_name: Optional name of the material to use or create - color: Optional [R, G, B] color values (0.0-1.0)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
colorNo
material_nameNo
object_nameYes

Implementation Reference

  • The MCP tool handler and registration for 'set_material'. Decorated with @mcp.tool(), it constructs parameters from inputs and sends a 'set_material' command to the Blender socket connection, returning success or error message. The docstring provides the input schema description.
    @mcp.tool() def set_material( ctx: Context, object_name: str, material_name: str = None, color: List[float] = None ) -> str: """ Set or create a material for an object. Parameters: - object_name: Name of the object to apply the material to - material_name: Optional name of the material to use or create - color: Optional [R, G, B] color values (0.0-1.0) """ try: # Get the global connection blender = get_blender_connection() params = {"object_name": object_name} if material_name: params["material_name"] = material_name if color: params["color"] = color result = blender.send_command("set_material", params) return f"Applied material to {object_name}: {result.get('material_name', 'unknown')}" except Exception as e: logger.error(f"Error setting material: {str(e)}") return f"Error setting material: {str(e)}"

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/VAST-AI-Research/tripo-mcp'

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