Skip to main content
Glama

add_primitive

Add 3D primitive objects like cubes, spheres, and cylinders to Cinema 4D scenes with customizable names, positions, and dimensions for scene construction.

Instructions

Add a primitive object to the Cinema 4D scene.

Args:
    primitive_type: Type of primitive (cube, sphere, cone, cylinder, plane, etc.)
    name: Optional name for the new object
    position: Optional [x, y, z] position
    size: Optional [x, y, z] size or dimensions

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
primitive_typeYes
nameNo
positionNo
sizeNo

Implementation Reference

  • The `add_primitive` handler function in `src/cinema4d_mcp/server.py` implements the tool by preparing a command object and sending it to Cinema 4D via a connection context.
    async def add_primitive(
        primitive_type: str,
        name: Optional[str] = None,
        position: Optional[List[float]] = None,
        size: Optional[List[float]] = None,
        ctx: Context = None,
    ) -> str:
        """
        Add a primitive object to the Cinema 4D scene.
    
        Args:
            primitive_type: Type of primitive (cube, sphere, cone, cylinder, plane, etc.)
            name: Optional name for the new object
            position: Optional [x, y, z] position
            size: Optional [x, y, z] size or dimensions
        """
        async with c4d_connection_context() as connection:
            if not connection.connected:
                return "❌ Not connected to Cinema 4D"
    
            # Prepare command
            command = {
                "command": "add_primitive",
                "type": primitive_type,
            }
    
            if name:
                command["object_name"] = name
            if position:
                command["position"] = position
            if size:
                command["size"] = size
    
            # Send command to Cinema 4D
            response = send_to_c4d(connection, command)
            return format_c4d_response(response, "add_primitive")

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