Skip to content

v2.35.6 — object-reference animation curves (2D sprite animation)

Choose a tag to compare

@francoios francoios released this 27 Jul 12:22
· 97 commits to main since this release
826af5c

Companion to plugin v2.39.5.

🎬 2D sprite animation now works through the MCP (thanks @VM233, #30)

Animating SpriteRenderer.m_Sprite requires an object-reference curve. unity_animation_set_clip_curve goes through AnimationCurve, which can only express float values — so sprite-frame animation had no route through the MCP at all, and had to be hand-written as .anim YAML. That's fragile across Unity versions and produced curve type is invalid import errors.

New unity_animation_set_object_reference_curve:

{
  "clipPath": "Assets/Anim/GreenLizardIdle.anim",
  "type": "SpriteRenderer",
  "propertyName": "m_Sprite",
  "keyframes": [
    { "time": 0,     "assetPath": "Assets/Art/lizard.png", "name": "lizard_0" },
    { "time": 0.083, "assetPath": "Assets/Art/lizard.png", "name": "lizard_1" }
  ]
}
  • Unity writes the binding itself (AnimationUtility.SetObjectReferenceCurve) — no hand-built YAML.
  • name picks a single Sprite sub-asset out of a sliced sprite sheet; type and propertyName default to SpriteRenderer / m_Sprite, so the common case is just clipPath + keyframes.
  • Fails closed: if any keyframe can't be resolved the whole call is rejected and lists which ones — a clip that silently animates to the wrong sprites is worse than an error.

unity_animation_clip_info now reports object-reference curves (objectReferenceCurves with binding path, property, type, and each keyframe's time + resolved asset path). A correct sprite clip previously reported curveCount: 0 and looked empty, so there was no way to verify a generated clip.

🧹 Changed

  • Advanced tier 268 → 269 tools (347 total), synced across the pinned tier test and manifest.json.

📦 Install

npx anklebreaker-unity-mcp@latest

Verification

60/60 tests, all four CI matrix jobs green. A real 3-frame sprite clip was built through the actual MCP tool, read back via clip_info, and force-reimported in Unity: 0 console errors, all sprite references resolved.

Full changelog: CHANGELOG.md