list_objects
Retrieve all objects in the current Cinema 4D scene to manage 3D models and scene hierarchy for AI-assisted modeling workflows.
Instructions
List all objects in the current Cinema 4D scene.
If this tool returns a validation error, use execute_python_script as a fallback
to traverse the object hierarchy manually via the c4d API.Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/cinema4d_mcp/server.py:514-525 (handler)The handler function `list_objects` that interacts with Cinema 4D via a connection to retrieve objects.
async def list_objects(ctx: Context) -> str: """List all objects in the current Cinema 4D scene. If this tool returns a validation error, use execute_python_script as a fallback to traverse the object hierarchy manually via the c4d API. """ async with c4d_connection_context() as connection: if not connection.connected: return "❌ Not connected to Cinema 4D" response = send_to_c4d(connection, {"command": "list_objects"}) return format_c4d_response(response, "list_objects") - src/cinema4d_mcp/server.py:213-220 (helper)Formatting logic for the `list_objects` response, located within the `format_c4d_response` helper function.
elif command_type == "list_objects": objects = response.get("objects", []) if not objects: return "Scene is empty — no objects found." lines = [f"📦 **Scene Objects** ({len(objects)} total)"] for obj in objects: indent = " " * obj.get("depth", 0) lines.append(f" {indent}- **{obj['name']}** ({obj.get('type', '?')})")