configureAnimationAction
Configure animation actions for 3D objects in Spline scenes by setting animation type, duration, easing, and parameters to create rotate, move, scale, or fade effects.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sceneId | Yes | Scene ID | |
| actionId | Yes | Action ID | |
| objectId | Yes | Object ID to animate | |
| animationType | Yes | Animation type | |
| duration | Yes | Animation duration (ms) | |
| easing | No | Animation easing | |
| parameters | Yes | Animation-specific parameters |
Implementation Reference
- src/tools/action-tools.js:168-202 (handler)The main handler function that implements the tool logic: constructs animation parameters and sends a PUT request to update the action on the Spline server.async ({ sceneId, actionId, objectId, animationType, duration, easing, parameters }) => { try { const actionParameters = { objectId, animationType, duration, ...(easing && { easing }), ...parameters, }; await apiClient.request('PUT', `/scenes/${sceneId}/actions/${actionId}`, { type: 'animation', parameters: actionParameters }); return { content: [ { type: 'text', text: `Animation action ${actionId} configured successfully` } ] }; } catch (error) { return { content: [ { type: 'text', text: `Error configuring animation action: ${error.message}` } ], isError: true }; } }
- src/tools/action-tools.js:159-167 (schema)Zod schema defining input parameters for the configureAnimationAction tool.sceneId: z.string().min(1).describe('Scene ID'), actionId: z.string().min(1).describe('Action ID'), objectId: z.string().min(1).describe('Object ID to animate'), animationType: z.enum(['rotate', 'move', 'scale', 'fade']).describe('Animation type'), duration: z.number().min(0).describe('Animation duration (ms)'), easing: z.enum(['linear', 'easeIn', 'easeOut', 'easeInOut']).optional() .describe('Animation easing'), parameters: z.record(z.any()).describe('Animation-specific parameters'), },
- src/tools/action-tools.js:157-203 (registration)The server.tool() call that registers the configureAnimationAction tool with its schema and handler.'configureAnimationAction', { sceneId: z.string().min(1).describe('Scene ID'), actionId: z.string().min(1).describe('Action ID'), objectId: z.string().min(1).describe('Object ID to animate'), animationType: z.enum(['rotate', 'move', 'scale', 'fade']).describe('Animation type'), duration: z.number().min(0).describe('Animation duration (ms)'), easing: z.enum(['linear', 'easeIn', 'easeOut', 'easeInOut']).optional() .describe('Animation easing'), parameters: z.record(z.any()).describe('Animation-specific parameters'), }, async ({ sceneId, actionId, objectId, animationType, duration, easing, parameters }) => { try { const actionParameters = { objectId, animationType, duration, ...(easing && { easing }), ...parameters, }; await apiClient.request('PUT', `/scenes/${sceneId}/actions/${actionId}`, { type: 'animation', parameters: actionParameters }); return { content: [ { type: 'text', text: `Animation action ${actionId} configured successfully` } ] }; } catch (error) { return { content: [ { type: 'text', text: `Error configuring animation action: ${error.message}` } ], isError: true }; } } );