Try   HackMD

This is the ground truth document for #120406: Slotted Actions Planning.

Slotted Actions Planning

For more context, see:

Goals: ability to animate with the new multi-slot Action, and having different data-blocks animated by the same Action.

Non-goals: layers, strips on layers, animation-level constraints, bone pickers.

Each phase after 3 should have some time to iterate on the new functionality with animators.

1: ✅ Existing code for the data model → main

#118677: Implement the Data Model

2: ✅ Data Model access via existing UI

#119875: add layered Action to anim filtering code

Goal: minimal working state for animators to animate anything.

  • Hooking up to the existing animation filtering code
    • Research existing code
    • Add layered Action support
    • Dope Sheet
    • Graph Editor
  • Adding Slots to animation filtering code
    • Action editor (#122672)
    • Dope Sheet (decided to not show slots here)
    • Graph Editor (decided to not show slots here)
  • Key Insertion:
    • From 3D Viewport (#119669)
    • From context menu on properties
    • From Graph Editor
    • From Dope Sheet Editor (all modes except Action/GP)
    • From Action Editor (worked, but not longer after slots are shown there)
    • From Grease Pencil dope sheet mode
    • 'Follow Path' constraint, which sets up animation stuff by itself.
    • Finding all other use sites of keyframe-insertion code. (Discussed in a meeting with Sergey, and he suggested just getting the knowns working, and let the unknowns get discovered through testing rather than scouring the code base.)
  • Key insertion (also via Python): XYZ-to-RGB
  • Icon design for slots → discuss with Pablo Vazquez. (moved to a later phase to not delay marking this one as finished)

End-of-subphase goal: Animators can animate with a file that has been set up for animation by the devs. Update: practical animation will likely be too hindered by not having F-Curve groups (which also causes things like 'only for selected bones' to not work).

3: Creating & Assigning Actions

  • Action assigning UI
    • Selecting the slot in the Action editor (#125416)
    • Action + Slot selector in Properties panel (#125666), also for non-Object datablocks. WEEK 1 Sybren
  • Action creation UI/UX
    • Creating new Action + slot through inserting the first key
    • Ensuring (Object + Object Data) and (ID + embedded ID) by default use the same Action (#126655, WEEK 1 Christoph)
  • Slot creation via key insertion.
  • Slot creation via operators on the selector. (#126943) WEEK 0 Sybren
  • Slot unassignment operators. (#126943) WEEK 0 Sybren
  • Deleting Slots. (#127112, WEEK 1 Sybren)

End-of-subphase goal: Animators can animate a file from scratch.

4: Organisation of animation channels

This phase focuses on getting feature parity with the legacy Action F-Curve groups.

  • Key selection via group rows in action/dopesheet editor. (There's a bug currently that makes this not work properly.) WEEK 1 Nathan + Sybren
  • Flags (enable/disable, protected, etc).
  • Automatic creation of new groups, when new F-Curves are created.
  • Automatically add new F-Curves to existing groups, when they already exist.
  • Manual grouping & un-grouping of FCurves, and moving FCurves and groups up/down in the channel list. WEEK 1 Nathan
  • Python API for groups on channel bags.
  • Backwards-compatibility Python API on action.groups. WEEK 1 Sybren
  • Fixing indentation of animation channels. WEEK 1 Nathan
  • Channel list in Action editor: dim the contents of a slot when that slot is unassigned. WEEK 1 Nathan

End-of-subphase goal: Animators don't get lost in their long lists of channels.

5: Data Model Polishing

  • Change how strips store their data. Instead of storing the data inside the strip itself, the strip data should be stored in a flat array on the Action. Strips should reference this array, to make instancing trivial. WEEK 2 + 3 Nathan
    • Implement the new data model (#126559)
    • Type refinement of RNA structs for the Strip (#127859)
    • Deleting unused strip data array entries (#127837)

6: Feature Par with Actions

  • Autokeying
  • Selection syncing (objects/bones/otherthings vs. their animation channels) if feasible to do with the current code base for this.
  • Cycle-aware keying? At least to the point how it works now.
  • Dopesheet & Graph Editor filters.
  • Cleanup pass on C++ API moving some F-Curve related functions from KeyframeStrip to ChannelBag.
  • Icon design for slots (#123372).

End-of-subphase goal: Animators can work with the multi-slot Actions as comfortably as with legacy Actions.

7: Ensuring all the other code can work with layered Actions

There will be much code that doesn't go through the animation filtering or key insertion systems, but directly accesses action->curves. This code needs to be updated to handle layered Actions.

✅ 8: Tooling

  • Conversion operator from Legacy to Layered Action.
    • Converting groups properly in legacy → layered action conversion operator. WEEK 1 Christoph
  • Conversion from single-slot Action to legacy Action? somewhat automatic given backward-compatible API + forward compatibility.
  • Tools for joining & splitting Actions (#126937) WEEK 3 Christoph
    • Join all Actions of the selected objects into the Action of the active Object. (#127414)
      • Join action of object data (+ embedded IDs) into the Action of the active Object.
    • Split 1 multi-slot Action → N single-slot Actions.
    • In Action editor: right-click on slot → Move to New Action (#128171)
  • Action menu in Action editor, to hold these operations. (#128171)WEEK 3 Christoph
  • Library Override / non-editability of non-overridden linked data. Even when nothing should be overridable, there should be time to think about this and make clear decisions (+ document those). WEEK 4 Sybren (#128708, if there's more we can fix those when we find them)

✅ 9: Proven Explanations & Documentation

  • We need to be able to explain multi-slot Actions.
  • The explanation needs to be written down in the technical documentation.

✅ 10: NLA and Pose Library support

  • Investigate what is necessary for NLA support of single-layer, multi-slot Actions.
  • NLA support for single-layer Actions. WEEK 2 Sybren
    • NLA Strips: add Slot selector
    • Make animation evaluation work properly (without F-Curve/strip modifiers)
    • Support Tweak Mode
    • Support F-Curve/strip modifiers
  • Pose Library should produce & work with multi-slot Actions. (#128594 and #128686) WEEK 5 Nathan
  • Push Down (WEEK 5 Sybren, #128444)
  • Stash (#128696)
  • Key insertion: allow in NLA tweak mode (WEEK 5 Sybren, #128446)
  • Key insertion: NLA time remapping (WEEK 5 Sybren, #128700)
  • Check other places where NLA time remapping is done (is fine, BKE_nla_tweakedit_remap() does not directly use the Action itself)
  • (not NLA/Poselib, but also to do:) Test motion tracker. (is fine, doesn't create an Action itself, just inserts keys)

✅ 11: Going out of Experimental

  • Versioning to convert legacy Actions to layered ones (behind experimental flag). (WEEK 3 Christoph #127842)
  • Make the Python API for legacy Actions work with single-slot, single-layer Actions as well.
  • Forward compatibility: write F-Curves of the first slot, first strip, first layer as legacy F-Curves as well.
  • Do not return MutableSpan<> any more (for slots/layers/etc.) but always use Span<>. WEEK 5 Sybren
  • Add copying of tmpact slot and handle in rna_AnimaData_override_apply
  • Remove the experimental flag
    • Make PR WEEK 6 Sybren (#128889)
    • Land in main for Blender 4.4 (WEEK 6+ Sybren)
  • Updating the User Manual
    • Make PR for Action page WEEK 5+ Nathan: #104974
    • Update other pages that show/reference the action selector to also show/reference the slot selector:

12: A Few Hours Lateur (well, weeks or months)

  • Remove code that deals with the legacy Action data WEEK (NOW+2)+

This is mostly to remove then-dead code. It is deferred until we're confident that the new code is doing the right thing, and we don't need the old code as reference any more for regressions.

Other things, which will likely have to wait until later phases:

  • Per-FCurve-group modifiers. But maybe those become 'modifier strips', and scoping of those is done on a per-layer level.
  • Animation Filtering code replacement. Becomes a little more important when looking at FCurve groups. Those will likely be reimplemented from scratch to get rid of weird ListBase dependent stuff.
  • Fine-grained dependency graph nodes. Currently the Action can only be tagged for update as a whole, causing a full re-evaluation of all animated data-blocks. This should be more granular.
  • Enriching F-Curve grouping functionality:
    • Automatic creation of "manual" groups
    • Automatic (implicit) grouping of FCurves?
    • Automatic sorting of FCurves:
      • First location, then rotation, then scale, then the rest
      • Keeping array elements sequential & in array order
    • Manual reordering of Slots within an Animation