set_keyframe
Set keyframes for object properties in Cinema 4D to animate 3D scenes by specifying object name, property, value, and frame number.
Instructions
Set a keyframe for an object property.
Args:
object_name: Name of the object
property_name: Name of the property to keyframe (e.g., 'position.x')
value: Value to set at the keyframe
frame: Frame number to set the keyframe atInput Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| object_name | Yes | ||
| property_name | Yes | ||
| value | Yes | ||
| frame | Yes |
Implementation Reference
- src/cinema4d_mcp/server.py:670-688 (handler)The implementation of the 'set_keyframe' tool handler.
async def set_keyframe( object_name: str, property_name: str, value: Any, frame: int, ctx: Context ) -> str: """ Set a keyframe for an object property. Args: object_name: Name of the object property_name: Name of the property to keyframe (e.g., 'position.x') value: Value to set at the keyframe frame: Frame number to set the keyframe at """ async with c4d_connection_context() as connection: if not connection.connected: return "❌ Not connected to Cinema 4D" # Send command to Cinema 4D response = send_to_c4d( connection,