Anim: make existing code deal with layered Actions #123424

Closed
opened 2024-06-19 11:02:10 +02:00 by Sybren A. Stüvel · 0 comments

Existing code that handles Actions needs to be able to deal with layered Actions. This can either mean explicit rejection or operating properly, but a choice has to be made.

  • NLA: assigning layered Actions to strips
  • NLA: pushing down & stashing layered Actions
  • NLA: toggling tweak mode on/off
  • BKE_animdata_merge_copy
  • animdata_copy_id_action
  • action_idcode_patch_check()
  • what_does_obaction()
  • BKE_animdata_fix_paths_rename() (addressed as part of #127920)
  • Bake Action operator
  • BKE_animdata_transfer_by_basepath / action_move_fcurves_by_basepath / animdata_move_drivers_by_basepath
  • All the looping over act->curves
    • #127920 (just searching for sites that use LISTBASE_FOREACH).
    • Things found but not addressed while putting together #127920:
      • #128036 BKE_fcurve_find() uses listbase looping, but it's used all over the place, so investigating and addressing all call sites has been left for a future PR.
      • #128039 BKE_fcurves_filter() is only used in one place (updateDuplicateActionConstraintSettings()), but its use-site is complicated and will probably need a PR of it's own to handle properly.
      • #128064 Just trivially updating the loops in grease_pencil_convert_legacy.cc isn't enough, because it does some custom transferring of fcurves between listbases. Updating that code should probably be a PR of its own.
      • #128069 In gpencil_bake_animation.cc there is a function animdata_keyframe_list_get() that loops over the fcurve listbase and is only called from gpencil_bake_grease_pencil_animation_exec(). However, the semantics of how it's used in that function aren't immediately obvious, so it should get some special attention from someone who knows what's going on. Therefore leaving it for the future.
        • Also an identical function (literally a copy-paste) in gpencil_mesh.cc, with a similar situation. Probably should be handled together.
      • #128363:
        • sequencer_paste_animation() uses the listbase loop, but is also appending to a destination listbase. Needs more special attention.
        • In sequencer/intern/animation.cc, SEQ_fcurves_by_strip_get() takes a listbase of fcurves and loops over them. However, one of its call sites makes it not completely trivial to just swap out with a Span<FCurve *>. So punting on this to be handled in a separate PR.
      • #128061: In BCAnimationSampler.cpp, add_keyframes_from() uses the listbase loop. However, this is a case where we actually want to use fcurves_for_action_slot() because it's always called in a context specific to an animated ID. I (Nathan) thought it would be straightforward, but 20 minutes later and I had touched a lot of code, and still wasn't quite done. So this probably deserves a PR of its own.
  • #128440:
    • Translating strips in the sequence editor doesn't move their keyframes with them like it should.
    • Duplicating strips in the sequence editor doesn't duplicate their animation.
    • Deleting strips in the sequence editor doesn't delete their animation.
  • All the looping over act->groups
  • Update collada importer code (in io/collada/AnimationImporter.cpp). (#128529)
  • fcurves_path_remove_fix() and its call sites. (#128252)
  • ED_curve_updateAnimPaths and its call sites. (#128428)
  • check the above list is complete, and if not, extend.

Ref: #120406

Existing code that handles Actions needs to be able to deal with layered Actions. This can either mean explicit rejection or operating properly, but a choice has to be made. - [x] NLA: assigning layered Actions to strips - [x] NLA: pushing down & stashing layered Actions - [x] NLA: toggling tweak mode on/off - [x] `BKE_animdata_merge_copy` - [x] `animdata_copy_id_action` - [x] `action_idcode_patch_check()` - [x] `what_does_obaction()` - [x] `BKE_animdata_fix_paths_rename()` (addressed as part of #127920) - [x] Bake Action operator - [x] `BKE_animdata_transfer_by_basepath` / `action_move_fcurves_by_basepath` / `animdata_move_drivers_by_basepath` - [x] All the looping over `act->curves` - [x] #127920 (just searching for sites that use `LISTBASE_FOREACH`). - Things found but not addressed while putting together #127920: - [x] #128036 `BKE_fcurve_find()` uses listbase looping, but it's used *all over the place*, so investigating and addressing all call sites has been left for a future PR. - [x] #128039 `BKE_fcurves_filter()` is only used in one place (`updateDuplicateActionConstraintSettings()`), but its use-site is complicated and will probably need a PR of it's own to handle properly. - [x] #128064 Just trivially updating the loops in `grease_pencil_convert_legacy.cc` isn't enough, because it does some custom transferring of fcurves between listbases. Updating that code should probably be a PR of its own. - [x] #128069 In `gpencil_bake_animation.cc` there is a function `animdata_keyframe_list_get()` that loops over the fcurve listbase and is only called from `gpencil_bake_grease_pencil_animation_exec()`. However, the semantics of how it's used in that function aren't immediately obvious, so it should get some special attention from someone who knows what's going on. Therefore leaving it for the future. - [x] Also an identical function (literally a copy-paste) in `gpencil_mesh.cc`, with a similar situation. Probably should be handled together. - [x] [#128363](https://projects.blender.org/blender/blender/pulls/128363): - `sequencer_paste_animation()` uses the listbase loop, but is also appending to a destination listbase. Needs more special attention. - In `sequencer/intern/animation.cc`, `SEQ_fcurves_by_strip_get()` takes a listbase of fcurves and loops over them. However, one of its call sites makes it not completely trivial to just swap out with a `Span<FCurve *>`. So punting on this to be handled in a separate PR. - [x] #128061: In `BCAnimationSampler.cpp`, `add_keyframes_from()` uses the listbase loop. However, this is a case where we actually want to use `fcurves_for_action_slot()` because it's always called in a context specific to an animated ID. I (Nathan) thought it would be straightforward, but 20 minutes later and I had touched a lot of code, and still wasn't quite done. So this probably deserves a PR of its own. - [x] #128440: - Translating strips in the sequence editor doesn't move their keyframes with them like it should. - Duplicating strips in the sequence editor doesn't duplicate their animation. - Deleting strips in the sequence editor doesn't delete their animation. - [x] All the looping over `act->groups` - [x] Update collada importer code (in `io/collada/AnimationImporter.cpp`). (#128529) - [x] `fcurves_path_remove_fix()` and its call sites. (#128252) - [x] `ED_curve_updateAnimPaths` and its call sites. (#128428) - [x] check the above list is complete, and if not, extend. Ref: #120406
Sybren A. Stüvel added the
Module
Animation & Rigging
Type
To Do
labels 2024-06-19 11:02:10 +02:00
Sybren A. Stüvel self-assigned this 2024-06-19 15:57:40 +02:00
Blender Bot added the
Status
Archived
label 2024-10-07 16:50:41 +02:00
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Code Documentation
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
FBX
Interest
Freestyle
Interest
Geometry Nodes
Interest
glTF
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Viewport & EEVEE
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Asset Browser Project
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Asset System
Module
Core
Module
Development Management
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Module
Viewport & EEVEE
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Severity
High
Severity
Low
Severity
Normal
Severity
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#123424
No description provided.