2.8 KiB
| name | description | metadata | ||
|---|---|---|---|---|
| animation-modify | Apply a batch of modifications to a Unity `AnimationClip` — set/remove float curves, clear all curves, set frame rate / wrap mode / legacy flag, add or clear animation events. Use 'animation-get-data' first to discover valid curve bindings. |
|
Animation / Modify
Apply a batch of modifications to a Unity AnimationClip asset. Each modification is dispatched by its ModificationType discriminator. Use 'animation-get-data' first to discover valid property names and existing curves so the diff is targeted.
Inputs
animRef— reference to theAnimationClipasset (path must start withAssets/and end with.anim).modifications— array ofAnimationModificationentries.
Supported modification types
SetCurve— add or replace a float animation curve (path,propertyName,type,keyframes).RemoveCurve— remove a specific binding.ClearCurves— remove every curve from the clip.SetFrameRate— set the clip's frame rate.SetWrapMode— set the clip'sWrapMode.SetLegacy— toggle the legacy animation flag.AddEvent— append an animation event (time,functionName,intParameter,floatParameter,stringParameter).ClearEvents— remove every animation event.
Behavior
Per-modification errors are accumulated in the response's errors array instead of aborting the whole batch. Events are applied as a single rewrite after all per-entry mutations finish.
How to Call
unity-mcp-cli run-tool animation-modify --input '{
"animRef": "string_value",
"modifications": "string_value"
}'
For complex input (multi-line strings, code), save the JSON to a file and use:
unity-mcp-cli run-tool animation-modify --input-file args.jsonOr pipe via stdin (recommended):
unity-mcp-cli run-tool animation-modify --input-file - <<'EOF' {"param": "value"} EOF
Troubleshooting
If unity-mcp-cli is not found, either install it globally (npm install -g unity-mcp-cli) or use npx unity-mcp-cli instead.
Read the /unity-initial-setup skill for detailed installation instructions.
Input
| Name | Type | Required | Description |
|---|---|---|---|
animRef |
string |
Yes | Reference to the AnimationClip asset to modify. RQL: AssetObjectRef |
modifications |
string |
Yes | Array of modifications to apply to the clip. RQL: [AnimationModification] |
Input JSON Schema
{
"type": "object",
"properties": {
"animRef": {
"type": "string"
},
"modifications": {
"type": "string"
}
},
"required": [
"animRef",
"modifications"
]
}
Output
This tool does not return structured output.