tmhsdigital/blender-developer-tools/slotted-actions-animation
Claude Code and agent skill by tmhsdigital/blender-developer-tools
- community
- ext:[{"type":"plugin","description":"Custom plugin integration"}]
Checking that the SKILL.md file is still in the repository.
Create and edit animation from Python under Slotted Actions (Blender 4.4+): Action, slots, layers, strips, channelbags. Bind the action slot, then reach F-curves through a channelbag; action_ensure_channelbag_for_slot exists only on 5.0+, so use strip.channelbag(slot, ensure=True) on 4.5 LTS. Use when the user inserts keyframes or builds F-curves in a script, hits AttributeError on action.fcurves in 5.x, or has keys that exist but never play back. Targets 5.2 LTS with 4.5 LTS fallback.
Install
npx vskill@latest install tmhsdigital/blender-developer-tools/slotted-actions-animationSemi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
The same SKILL.md was published earlier as tmhsdigital/blender-developer-tools/slotted-actions-animation.
Slotted Actions Animation
Trigger
Use this skill when the user:
- Wants to create or edit animation from Python in Blender 5.x
- Mentions
Action,slot,channelbag,keyframe_insert,fcurves - Has older 4.x animation code (
action.fcurves.new(...)) that no longer works in 5.x - Asks how to insert keyframes programmatically and have them persist
What changed and why
Blender 4.4 introduced the Slotted Actions data model to support non-linear, multi-target animation. The old model was a flat list of F-curves owned directly by the Action, which made it impossible for one Action to drive two different IDs (e.g. an armature pose and the armature's custom property channels at the same time) without overwriting each other.
Two version boundaries matter:
- Blender 4.4 / 4.5 LTS: the slotted data model (
action.slots,action.layers,strip.channelbag) is present alongside the legacy flat API (action.fcurves,action.groups,action.id_root), which still works as a proxy. The helperbpy_extras.anim_utils.action_get_channelbag_for_slot(action, slot)exists;action_ensure_channelbag_for_slotdoes not. - Blender 5.0+: the legacy flat API was removed (
action.fcurvesraisesAttributeError). The new helperbpy_extras.anim_utils.action_ensure_channelbag_for_slot(action, slot)is added.
The slotted model:
On 5.0+, code that walks action.fcurves directly raises AttributeError because that property was removed; the F-curves live inside a Channelbag inside a Strip inside a Layer. On 4.4 / 4.5 LTS action.fcurves still works as a proxy.
Getting a channelbag across versions
bpy_extras.anim_utils.action_ensure_channelbag_for_slot(action, slot) is new in Blender 5.0. It ensures the Action has a Layer, a Strip in that Layer, and a Channelbag for the given Slot, then returns the Channelbag. It does not exist on 4.4 / 4.5 LTS — there is no auto-detecting shim, and importing-and-calling it on 4.5 raises AttributeError.
On 4.4 / 4.5 LTS, ensure the channelbag yourself with strip.channelbag(slot, ensure=True) (the slotted model is present there). The still-present legacy action.fcurves is a trap on a fresh Action: it creates a slot but does not bind it (see the legacy section below). So a genuinely cross-version helper must branch on bpy.app.version:
Import path (5.0+) verified against the Blender 5.1 API reference: bpy_extras.anim_utils.action_ensure_channelbag_for_slot(action, slot). See `bpy_extras.anim_utils`.
<!-- smoke: run -->
The version boundary that matters is bpy.app.version >= (5, 0, 0) (legacy removed / ensure-helper added), not hasattr(action, "slots") — action.slots is present on 4.4 and 4.5 too, so that check does not distinguish 4.5 from 5.x.
Inserting keyframes the cross-version way
The high-level obj.keyframe_insert(data_path, frame=...) works on both 4.5 LTS and 5.x and is the preferred entry point for most cases. Blender takes care of the slot/layer/strip/channelbag plumbing internally.
Each keyframe_insert adds keys for all three components of location (since it's a vector). index=0 would key only X.
This works on 4.5 LTS and 5.x without any version branching.
When you need direct F-curve access
For programmatic curve construction (importing motion capture, writing a curve solver, building a baked animation track), you need the F-curves directly:
Notes:
options={'FAST'}skips per-insertion sorting and curve update; callfc.update()once at the end.cbag.fcurvesis the unified access point on both 4.4/4.5 LTS and 5.x. Theget_channelbag_for_slothelper above returns the slot's real Channelbag on every version (viastrip.channelbag(slot, ensure=True)on 4.4/4.5, the ensure-helper on 5.0+).
The legacy action.fcurves path (4.4 / 4.5 LTS only)
On 4.4 and 4.5 LTS the legacy flat API is still present, but on a fresh Action it does not bind a slot. action.fcurves.new(...) creates a slot named Legacy Slot and leaves obj.animation_data.action_slot as None, so the keys exist and the object never animates. Bind the slot yourself after the first legacy write:
Measured on 4.5.11 LTS: without the action_slot line, frame_set(24) leaves the object at its rest value. Prefer the channelbag path (get_channelbag_for_slot above), which binds the slot before writing on every version. On 5.0+ the action.fcurves attribute was removed entirely, so action.fcurves.new(...) raises AttributeError.
Detecting the version boundaries
The slotted data model (and action.slots) is meaningful on 4.4 and 4.5 too, so do not gate slot code behind >= (5, 0). The boundary that decides legacy-removal and which channelbag helper exists is >= (5, 0, 0) — that is the check get_channelbag_for_slot uses above.
Common AI mistakes
- Using legacy `action.fcurves.new(...)` in 5.x code. On Blender 5.0+ the
action.fcurvesproperty was removed, so this raisesAttributeError: 'Action' object has no attribute 'fcurves'. Go through a channelbag instead.
- Forgetting the slot binding:
``python action = bpy.data.actions.new("A") obj.animation_data.action = action # Missing: setting obj.animation_data.action_slot ``
Without a slot binding, the Action has no idea which datablock it drives. Symptom: animation plays back as if it isn't there. On 4.5 LTS the legacy action.fcurves.new(...) path hits this silently: it creates a slot but never assigns it.
- Hardcoding the import path to where it was in some older 5.x. Verify against current docs:
- 5.1+:
from bpy_extras.anim_utils import action_ensure_channelbag_for_slot
- Not calling `fcurve.update()` after bulk inserts with
options={'FAST'}. The curve is internally sorted and analytically prepared byupdate().
- Treating `obj.animation_data` as always present. It is
Noneon a fresh object. Callobj.animation_data_create()first.
- Using `keyframe_insert` for high-volume baking. It is convenient but slow for thousands of frames. Use direct F-curve access with
options={'FAST'}for performance.
Compatibility paths summary
| Operation | 4.4 / 4.5 LTS | 5.x | Cross-version | |
|---|---|---|---|---|
| Insert a single keyframe | obj.keyframe_insert("location", frame=1) | Same | High-level API works on both | |
| Get the F-curves for an Action+Slot | strip.channelbag(slot, ensure=True) (legacy action.fcurves only with an explicit action_slot bind) | action_ensure_channelbag_for_slot(action, slot) | get_channelbag_for_slot(action, slot) (branches on version) | |
| Create an Action | bpy.data.actions.new(...) | Same | Same | |
| Bind Action to ID | obj.animation_data.action = action + action_slot | Same | action_slot is settable on 4.4+; set both |
Related
addon-scaffoldingfor the registration of animation-driving operators- Snippet
action-ensure-channelbag-for-slot.pyfor a minimal copy-paste
<!-- examples:begin (generated by scripts/build_examples_index.py from examples/skills.json; do not edit) -->
Runnable examples
Each example runs headless, asserts the contract, and exits non-zero when it breaks. Run one with blender --background --python <script> --; pass a falsifier flag to watch the check fail.
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/slotted-actions-animation/SKILL.md
Popularity
- Repository stars
- 20
- Repository forks
- 5
- 7-day trend score
- 14
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Extension points
pluginCustom plugin integration
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/tmhsdigital/blender-developer-tools/slotted-actions-animation)