Skip to main content
Glama

apply_shader

Create and apply specialized shader materials like noise, gradient, or fresnel to objects in Cinema 4D scenes for enhanced visual effects.

Instructions

Create and apply a specialized shader material.

Args:
    shader_type: Type of shader (noise, gradient, fresnel, etc)
    material_name: Optional name of material to apply shader to
    object_name: Optional name of object to apply the material to

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
shader_typeYes
material_nameNo
object_nameNo

Implementation Reference

  • The handler function `apply_shader` executes the shader application logic by sending a command to the Cinema 4D connection.
    async def apply_shader(
        shader_type: str,
        material_name: Optional[str] = None,
        object_name: Optional[str] = None,
        ctx: Context = None,
    ) -> str:
        """
        Create and apply a specialized shader material.
    
        Args:
            shader_type: Type of shader (noise, gradient, fresnel, etc)
            material_name: Optional name of material to apply shader to
            object_name: Optional name of object to apply the material to
        """
        async with c4d_connection_context() as connection:
            if not connection.connected:
                return "❌ Not connected to Cinema 4D"
    
            command = {"command": "apply_shader", "shader_type": shader_type}
    
            if material_name:
                command["material_name"] = material_name
    
            if object_name:
                command["object_name"] = object_name
    
            response = send_to_c4d(connection, command)
            return format_c4d_response(response, "apply_shader")
  • The `apply_shader` tool is registered using the `@mcp.tool()` decorator.
    @mcp.tool()
    async def apply_shader(

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/ttiimmaacc/cinema4d-mcp'

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