cocos_create_animation_clip
Create animation clips for Cocos Creator projects by defining keyframes for properties like position, scale, rotation, opacity, color, and active state.
Instructions
Create a .anim AnimationClip file.
Each track dict: {path, property, keyframes: [{time, value}, ...]}. Properties: 'position' (value=[x,y,z]), 'scale' ([sx,sy,sz]), 'rotation' ([ez]), 'opacity' (0-255), 'color' ([r,g,b,a]), 'active' (bool).
Returns {path, rel_path, uuid}. Use uuid with cocos_add_animation().
Example track: {"path": "", "property": "position", "keyframes": [{"time": 0, "value": [0,0,0]}, {"time": 1, "value": [100,0,0]}]}
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"project_path": "<project_path>",
"clip_name": "<clip_name>"
},
"name": "cocos_create_animation_clip"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_path | Yes | ||
| clip_name | Yes | ||
| duration | No | ||
| sample | No | ||
| tracks | No | ||
| rel_dir | No |