Anim: Keyframing Rework #113278

Open
opened 2023-10-05 10:55:06 +02:00 by Christoph Lendenfeld · 5 comments

This is the working plan for the keying sets rework originally discussed here: https://devtalk.blender.org/t/keyframing-auto-keyframing-and-keying-sets/31125

Current Issues

Specific issues are listed here: https://developer.blender.org/docs/features/animation/module/weak_areas/

Too many options

When pressing I without a keying set, a whole list of options pop up that is not really needed. Conceptually, animators want to key "the thing" and not have to choose every time

Custom keying sets

They are bound to specific IDs so they will key only those when Insert Key is executed. This results in the object being keyed, even though it is not selected and invisible.

Channel locks are not respected

Keyframes can be added to a channel, even if it might be locked. A lock means that a channel can't be modified and that should include keys. This is especially important for linked rigs, where the lock is set by the rigger with an intention for that channel to not be touched.

Auto Keying fails unexpectedly

There are user preferences, that when enabled together produce unexpected results, failing to add keyframes during auto keying.

Planned Changes

Remove built in Keying Sets

The whole list of built in keying sets will be deleted. Instead we will add settings to the User Preferences, to define which channels should be keyed when Insert Key is executed. These options are:

  • Location
  • Rotation
  • Scale
  • Rotation Mode
  • Custom Properties

Visual Keying

With the list of keying sets gone, we still need a way to do visual keying. This will be a property on the Insert Key operator instead of part of the keying set. We could then bind it to a different hotkey or only expose it in the menu.

Never key locked Channels

Always check if a channel is locked before inserting a key, throw a warning if insertion is not possible. That means custom properties should be lockable, or at least not allow animation.

Make custom keying sets relative to the current selection

Instead of specifying a list of ID blocks the keying set should operate on, specify a list of RNA paths only. These paths will be searched for on every object in the selection. If found, a key will be added.

Auto Keying

Simplify the auto keying options. Add an enum for the keying mode that can have two states

  • Only Modified (Default)
  • Keying Set

The latter would try to insert all the properties specified in the keying set.
"Only insert available" would be a separate option, that would stop keys from being inserted when there is not already a key on the property. This option will only affect auto keying. Regular keying will have its own options.

Resulting logic flow

These diagrams do NOT show code structure. They should just help to visualize what is going to happen when certain actions are performed.

3D view Hover over channel via API
3d_view hovering via_api

Implementation Steps

Step 0 - Cleanup

Step 1 - manual keying

Step 2 - auto keying

Step 3

Step 4

  • Make custom keying sets relative to current selection
  • Remove redundant builtin keying sets
  • Use new keyframing code for keying sets
  • Reorder keying set menu and add divider lines

Step 5

  • Improve Python API for inserting keyframes
    object.keyframe_insert() already exists, but needs to have all its flags passed in. Needs a convenient way to fall back to user preferences.
    API needs to allow passing in the keyframe interpolation type of new keys.

Unit tests to add

  • Insert key on locked property
  • Insert key on locked FCurve
  • Insert key on linked armature
  • Insert key on library override armature
  • Insert key using python without operators
  • Inserting rotation keys uses the correct rna path depending on euler or quaternion

Issues to fix

Additional Design tasks

This is a list of other design tasks that are tangential to this and might be solved during the process

This is the working plan for the keying sets rework originally discussed here: https://devtalk.blender.org/t/keyframing-auto-keyframing-and-keying-sets/31125 # Current Issues Specific issues are listed here: https://developer.blender.org/docs/features/animation/module/weak_areas/ * [#97886: Keying sets other than Whole Character (or keyframing in general) do not respect channel locks](https://projects.blender.org/blender/blender/issues/97886) ### Too many options When pressing I without a keying set, a whole list of options pop up that is not really needed. Conceptually, animators want to key "the thing" and not have to choose every time ### Custom keying sets They are bound to specific IDs so they will key only those when `Insert Key` is executed. This results in the object being keyed, even though it is not selected and invisible. ### Channel locks are not respected Keyframes can be added to a channel, even if it might be locked. A lock means that a channel can't be modified and that should include keys. This is especially important for linked rigs, where the lock is set by the rigger with an intention for that channel to not be touched. ### Auto Keying fails unexpectedly There are user preferences, that when enabled together produce unexpected results, failing to add keyframes during auto keying. # Planned Changes ### Remove built in Keying Sets The whole list of built in keying sets will be deleted. Instead we will add settings to the User Preferences, to define which channels should be keyed when `Insert Key` is executed. These options are: * Location * Rotation * Scale * Rotation Mode * Custom Properties ### Visual Keying With the list of keying sets gone, we still need a way to do visual keying. This will be a property on the `Insert Key` operator instead of part of the keying set. We could then bind it to a different hotkey or only expose it in the menu. ### Never key locked Channels Always check if a channel is locked before inserting a key, throw a warning if insertion is not possible. That means custom properties should be lockable, or at least not allow animation. ### Make custom keying sets relative to the current selection Instead of specifying a list of ID blocks the keying set should operate on, specify a list of RNA paths only. These paths will be searched for on every object in the selection. If found, a key will be added. ### Auto Keying Simplify the auto keying options. Add an enum for the keying mode that can have two states * Only Modified (Default) * Keying Set The latter would try to insert all the properties specified in the keying set. "Only insert available" would be a separate option, that would stop keys from being inserted when there is not already a key on the property. This option will only affect auto keying. Regular keying will have its own options. # Resulting logic flow These diagrams do **NOT** show code structure. They should just help to visualize what is going to happen when certain actions are performed. | 3D view | Hover over channel | via API | | - | - | - | | ![3d_view](attachments/0800c459-0561-47f0-a561-8d935a0addd8) | ![hovering](attachments/d28cd35a-4632-4c2e-ac56-1d59d66c7d3f) | ![via_api](/attachments/911318cc-bd9e-4fc6-8ceb-e51fc382a658) | # Implementation Steps Step 0 - Cleanup * [x] [#113503: Refactor: Move keyframing code to animrig](https://projects.blender.org/blender/blender/pulls/113503) * [x] [#113588: Refactor: remove bAction* parameter from ANIM_apply_keyingset](https://projects.blender.org/blender/blender/pulls/113588) * [x] [#113595: Refactor: keyframing.cc](https://projects.blender.org/blender/blender/pulls/113595) * [x] [#113607: Refactor: Move autokeyframing functions to animrig](https://projects.blender.org/blender/blender/pulls/113607) * [x] [#113610: Refactor: Replace autokey macros with functions](https://projects.blender.org/blender/blender/pulls/113610) * [x] [#113612: Refactor: remove ED_ prefix from autokeying functions](https://projects.blender.org/blender/blender/pulls/113612) * [x] [#113617: Refactor: keyframing_auto.cc code cleanup](https://projects.blender.org/blender/blender/pulls/113617) * [x] [#113666: Refactor: keyingsets.cc](https://projects.blender.org/blender/blender/pulls/113666) * [x] [#113675: Refactor: convert ListBase of tRKS_DSource to Vector](https://projects.blender.org/blender/blender/pulls/113675) * [x] [#113677: Refactor: remove argument from ANIM_builtin_keyingset_get_named](https://projects.blender.org/blender/blender/pulls/113677) * [x] [#113817: Refactor: Remove nla_cache parameter from insert_keyframe](https://projects.blender.org/blender/blender/pulls/113817) * [x] [#113931: Refactor: ANIM_setting_get_rna_values to return a Vector](https://projects.blender.org/blender/blender/pulls/113931) * [x] [#114444: Refactor: move ANIM_setting_get_rna_values to animrig](https://projects.blender.org/blender/blender/pulls/114444) * [x] [#114445: Refactor: Move fcurve functions to animrig](https://projects.blender.org/blender/blender/pulls/114445) * [x] [#114448: Cleanup: Comments in animrig](https://projects.blender.org/blender/blender/pulls/114448) * [x] [#114450: Refactor: Rename functions in animrig to remove prefix](https://projects.blender.org/blender/blender/pulls/114450) * [x] [#114465: Anim: Unit tests for inserting keyframes](https://projects.blender.org/blender/blender/pulls/114465) Step 1 - manual keying * [x] Create channel selection in the User Preferences and use it in keying [#113504: Anim: Insert keyframes without keying sets](https://projects.blender.org/blender/blender/pulls/113504) * [x] [#115798: Anim: Add pie menu for adding keyframes](https://projects.blender.org/blender/blender/pulls/115798) * [ ] Add visual keying property to the keying operator * [ ] Add the `I` hotkey to the VSE: https://blender.community/c/rightclickselect/ZWrQ * [ ] Only Insert Available for normal keying Step 2 - auto keying * [x] Auto keying unit tests [#115064: Anim: Add basic autokey tests](https://projects.blender.org/blender/blender/pulls/115064) * [x] Fix "Insert Needed" (Only change channels that have actually been modified) [#115360: Anim: Change how Only Insert Needed works](https://projects.blender.org/blender/blender/pulls/115360) [#115525: Anim: Separate keying flags](https://projects.blender.org/blender/blender/pulls/115525) [#115522: Anim: Don't use keying sets when inserting keyframes during autokeying](https://projects.blender.org/blender/blender/pulls/115522) * [ ] insert keyframes on properties with auto-keying? Step 3 * [ ] Implement logic to always respect channel locks [#116227: WIP: Anim: Respect channels locks when inserting keyframes](https://projects.blender.org/blender/blender/pulls/116227) Step 4 * [ ] Make custom keying sets relative to current selection * [ ] Remove redundant builtin keying sets * [ ] Use new keyframing code for keying sets * [ ] Reorder keying set menu and add divider lines Step 5 * [ ] Improve Python API for inserting keyframes object.keyframe_insert() already exists, but needs to have all its flags passed in. Needs a convenient way to fall back to user preferences. API needs to allow passing in the keyframe interpolation type of new keys. # Unit tests to add * Insert key on locked property * Insert key on locked FCurve * Insert key on linked armature * Insert key on library override armature * Insert key using python without operators * Inserting rotation keys uses the correct rna path depending on euler or quaternion # Issues to fix * [x] [#95866: Changing the Driver while Auto Keying is on, causes new Keys on it's F-Curve](https://projects.blender.org/blender/blender/issues/95866) * Keying system is too verbose # Additional Design tasks This is a list of other design tasks that are tangential to this and might be solved during the process * [#113506: Set Custom Property to Non-animatable (toggle)](https://projects.blender.org/blender/blender/issues/113506)
Christoph Lendenfeld added this to the 4.1 milestone 2023-10-05 10:55:06 +02:00
Christoph Lendenfeld added the
Type
To Do
label 2023-10-05 10:55:06 +02:00
Christoph Lendenfeld self-assigned this 2023-10-05 10:55:07 +02:00
Christoph Lendenfeld added this to the Animation & Rigging project 2023-10-05 10:55:09 +02:00
Christoph Lendenfeld added the
Module
Animation & Rigging
label 2023-10-05 11:43:59 +02:00
Christoph Lendenfeld changed title from Keying Sets Rework to Anim: Keying Sets Rework 2023-10-05 12:08:16 +02:00
Christoph Lendenfeld changed title from Anim: Keying Sets Rework to Anim: Keyframing Rework 2023-10-05 12:19:11 +02:00

Just some first-glance feedback:

Rotation Order

Strictly speaking, there is no such thing in Blender. It's the rotation mode (which includes Euler rotation order, but also Quaternion and Axis/Angle modes).

Simplify the auto keying options.

(note: this is pretty much covered by the graphs you drew, but not yet part of the text. I would recommend writing the text such that it contains all the necessary information, with the images there support it. Images should not provide new information.)

(removed my notes here, the graphs cover those indeed -- I need to write feedback on more than a first glance ;-) )

What I think should still be designed / decided: what happens when auto-keying is on, and a property is changed that's not part of any loc/rot/scale/custom properties choice?


Also mention the things listed at https://wiki.blender.org/wiki/Modules/Animation-Rigging/Weak_Areas#Auto-keying in the description, so that things get linked together better.

Just some first-glance feedback: > Rotation Order Strictly speaking, there is no such thing in Blender. It's the rotation mode (which includes Euler rotation order, but also Quaternion and Axis/Angle modes). > Simplify the auto keying options. _(note: this is pretty much covered by the graphs you drew, but not yet part of the text. I would recommend writing the text such that it contains all the necessary information, with the images there support it. Images should not provide *new* information.)_ (removed my notes here, the graphs cover those indeed -- I need to write feedback on more than a first glance ;-) ) What I think should still be designed / decided: what happens when auto-keying is on, and a property is changed that's not part of any loc/rot/scale/custom properties choice? ----------- Also mention the things listed at https://wiki.blender.org/wiki/Modules/Animation-Rigging/Weak_Areas#Auto-keying in the description, so that things get linked together better.
Member

Instead we will add settings to the User Preferences, to define which channels should be keyed when Insert Key is executed.

Don't agree with this being a user preference. Insert key is a tool and it's settings should be definable on the fly as any other tool. What you want to keyframe changes from object to object even.

> Instead we will add settings to the User Preferences, to define which channels should be keyed when `Insert Key` is executed. Don't agree with this being a user preference. Insert key is a tool and it's settings should be definable on the fly as any other tool. What you want to keyframe changes from object to object even.
Author
Member

Don't agree with this being a user preference. Insert key is a tool and it's settings should be definable on the fly as any other tool. What you want to keyframe changes from object to object even.

It needs to be more accessible I agree. I've talked to the UI team about that briefly to have things that persist between files, but are within the GUI. No plans for it though.
IMO it would be worse to have the setting on the scene and then have to set it every single time you change your file.

Also, what about a pie menu with 4 options for loc, rot, scale and custom props.
you'd be able to quickly flick the mouse to insert what you want.

> Don't agree with this being a user preference. Insert key is a tool and it's settings should be definable on the fly as any other tool. What you want to keyframe changes from object to object even. It needs to be more accessible I agree. I've talked to the UI team about that briefly to have things that persist between files, but are within the GUI. No plans for it though. IMO it would be worse to have the setting on the scene and then have to set it every single time you change your file. Also, what about a pie menu with 4 options for loc, rot, scale and custom props. you'd be able to quickly flick the mouse to insert what you want.

Not being able to choose which property to keyframe from the viewport is a huge waste of time. Sometimes I only want location or rotation, but not scale, and sometimes I want all three.

Personally, it's annoying enough to make me want to stick with an older version when it comes to animation. 😅

Also, what about a pie menu with 4 options for loc, rot, scale and custom props.
you'd be able to quickly flick the mouse to insert what you want.

About this pie menu, we come back to the same problem, wanting to animate 2 properties out of 3 will double the number of entries. It also becomes a waste of time. Even though there were a lot of options in the "I" menu, it allowed you to quickly place keyframes on the properties you wanted.

Perhaps it would be a good idea to introduce a shortcut to access them again. Shift+I for example?

Thank you for your amazing work, I'm just a user that loves to animate 😊

Not being able to choose which property to keyframe from the viewport is a huge waste of time. Sometimes I only want location or rotation, but not scale, and sometimes I want all three. Personally, it's annoying enough to make me want to stick with an older version when it comes to animation. 😅 > Also, what about a pie menu with 4 options for loc, rot, scale and custom props. > you'd be able to quickly flick the mouse to insert what you want. > About this pie menu, we come back to the same problem, wanting to animate 2 properties out of 3 will double the number of entries. It also becomes a waste of time. Even though there were a lot of options in the "I" menu, it allowed you to quickly place keyframes on the properties you wanted. Perhaps it would be a good idea to introduce a shortcut to access them again. Shift+I for example? Thank you for your amazing work, I'm just a user that loves to animate 😊
Author
Member

Not being able to choose which property to keyframe from the viewport is a huge waste of time. Sometimes I only want location or rotation, but not scale, and sometimes I want all three.

Personally, it's annoying enough to make me want to stick with an older version when it comes to animation. 😅

I hear you and there is already a PR for it: #115798: Anim: Add hotkey for keying set operators
Thanks for making your voice heard! I appreciate it.

> Not being able to choose which property to keyframe from the viewport is a huge waste of time. Sometimes I only want location or rotation, but not scale, and sometimes I want all three. > > Personally, it's annoying enough to make me want to stick with an older version when it comes to animation. 😅 I hear you and there is already a PR for it: [#115798: Anim: Add hotkey for keying set operators](https://projects.blender.org/blender/blender/pulls/115798) Thanks for making your voice heard! I appreciate it.
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
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, Assets & 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
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
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
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
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
4 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#113278
No description provided.