Anim: Don't use keying sets when inserting keyframes during autokeying #115522

Merged
Christoph Lendenfeld merged 9 commits from ChrisLend/blender:autokey_remove_keying_sets into main 2023-12-14 09:04:20 +01:00

Prior to this PR, the autokeying system used keying sets
to insert keyframes where required.

With the functions introduced in #113504: Anim: Insert keyframes without keying sets
the code can be simplified and made to not rely on keying sets,
allowing autokeying to also insert keys by rna path directly.

This also removes all the code related to "Insert Needed" from autokeying.
The insert key functions deal with that now, all that is needed is to pass
in the flag.


Part of #113278: Anim: Keyframing Rework

Prior to this PR, the autokeying system used keying sets to insert keyframes where required. With the functions introduced in [#113504: Anim: Insert keyframes without keying sets](https://projects.blender.org/blender/blender/pulls/113504) the code can be simplified and made to not rely on keying sets, allowing autokeying to also insert keys by rna path directly. This also removes all the code related to "Insert Needed" from autokeying. The insert key functions deal with that now, all that is needed is to pass in the flag. ---- Part of [#113278: Anim: Keyframing Rework](https://projects.blender.org/blender/blender/issues/113278)
Christoph Lendenfeld added the
Module
Animation & Rigging
label 2023-11-28 15:28:27 +01:00
Christoph Lendenfeld added 2 commits 2023-11-28 15:28:46 +01:00
Christoph Lendenfeld changed title from WIP: Anim: Don't use keying sets when inserting keyframes during autokeying to Anim: Don't use keying sets when inserting keyframes during autokeying 2023-12-01 10:59:09 +01:00
Christoph Lendenfeld added 4 commits 2023-12-01 10:59:53 +01:00
Christoph Lendenfeld requested review from Nathan Vegdahl 2023-12-01 11:01:38 +01:00
Member

With the functions introduced in #113504: Anim: Insert keyframes without keying sets
the code can be simplified and not rely on keying sets,
but insert keys by rna path directly.

Just to clarify: autokeying still can use keying sets, it just doesn't have to? In other words, this PR brings auto-keying in line with the manual keying changes from the previous PR. If that's the case, I might tweak the PR description to make that clearer:

the code can be simplified and made to not rely on keying sets, allowing autokeying to also insert keys by rna path directly.

> With the functions introduced in [#113504: Anim: Insert keyframes without keying sets](https://projects.blender.org/blender/blender/pulls/113504) > the code can be simplified and not rely on keying sets, > but insert keys by rna path directly. Just to clarify: autokeying still *can* use keying sets, it just doesn't have to? In other words, this PR brings auto-keying in line with the manual keying changes from the previous PR. If that's the case, I might tweak the PR description to make that clearer: > the code can be simplified and made to not rely on keying sets, allowing autokeying to also insert keys by rna path directly.
Nathan Vegdahl requested changes 2023-12-11 12:37:55 +01:00
Nathan Vegdahl left a comment
Member

Just some minor nits and a question.

Also, I want to recall what @dr.sybren mentioned at the last module meeting, about getting feedback and testing on workflow-affecting changes before merging. Since this PR is essentially a continuation of the previous change that already got merged and is mainly just making things consistent with that, it seems less critical to me for this. But nevertheless it would be good to get it into some animators' hands for testing before landing, I think.

Just some minor nits and a question. Also, I want to recall what @dr.sybren mentioned at the last module meeting, about getting feedback and testing on workflow-affecting changes before merging. Since this PR is essentially a [continuation of the previous change](https://projects.blender.org/blender/blender/pulls/113504) that already got merged and is mainly just making things consistent with that, it seems less critical to me for this. But nevertheless it would be good to get it into some animators' hands for testing before landing, I think.
@ -141,3 +141,2 @@
void autokeyframe_object(
bContext *C, Scene *scene, ViewLayer *view_layer, Object *ob, eTfmMode tmode);
void autokeyframe_object(bContext *C, Scene *scene, Object *ob);
Member

Add documentation for this. I think it would be especially useful for the doc comments of this and autokeyframe_pose() to make it clear what the difference between them is, and what their respective responsibilities are.

Add documentation for this. I think it would be especially useful for the doc comments of this and `autokeyframe_pose()` to make it clear what the difference between them is, and what their respective responsibilities are.
Author
Member

well honestly I am not quite sure what the differences are yet. I realized there was this duplication when I moved all the functions into the same file. Once the refactoring is complete, it may be we can merge the functions

well honestly I am not quite sure what the differences are yet. I realized there was this duplication when I moved all the functions into the same file. Once the refactoring is complete, it may be we can merge the functions
nathanvegdahl marked this conversation as resolved
@ -143,3 +142,3 @@
bContext *C, Scene *scene, ViewLayer *view_layer, Object *ob, eTfmMode tmode);
void autokeyframe_object(bContext *C, Scene *scene, Object *ob);
/**
* Auto-keyframing feature - for objects
Member

"for objects" -> "for poses" (presumably).

"for objects" -> "for poses" (presumably).
Author
Member

This comment was moved as is when I moved the code. My best guess is that it was originally copy pasted from the autokeyframe_object function
Edit: I'll make a separate PR for this. No point in diluting the intent of this one

This comment was moved as is when I moved the code. My best guess is that it was originally copy pasted from the `autokeyframe_object` function Edit: I'll make a separate PR for this. No point in diluting the intent of this one
Member

Oh, interesting. Yeah, I think making a separate PR for the documentation changes/additions after more refactoring is fine. Maybe just add a TODO to update/add the docs, then?

Oh, interesting. Yeah, I think making a separate PR for the documentation changes/additions after more refactoring is fine. Maybe just add a TODO to update/add the docs, then?
Author
Member

actually I think the diff had us fooled here.
The docstring for autokeyframe_pose mentions for poses/pose-channels but the code was folded in a confusing way
Anyway I noticed the docstring still mentioned the tmode param. I removed that now

actually I think the diff had us fooled here. The docstring for `autokeyframe_pose` mentions `for poses/pose-channels` but the code was folded in a confusing way Anyway I noticed the docstring still mentioned the `tmode` param. I removed that now
nathanvegdahl marked this conversation as resolved
@ -100,3 +109,3 @@
/* Get flags used for inserting keyframes. */
flag = ANIM_get_keyframing_flags(scene, true);
eInsertKeyFlags flag = ANIM_get_keyframing_flags(scene, true);
Member

I think this can be const.

I think this can be const.
Author
Member

well spotted

well spotted
nathanvegdahl marked this conversation as resolved
@ -140,1 +150,3 @@
bool do_loc = false, do_rot = false, do_scale = false;
const float scene_frame = BKE_scene_frame_get(scene);
std::string rotation_rna_path = get_rotation_mode_path(eRotationModes(ob->rotmode));
Vector<std::string> rna_paths = {"location", rotation_rna_path, "scale"};
Member

Should this respect the "Default Key Channels", like manual keying does? Not saying it should, just double-checking.

Should this respect the "Default Key Channels", like manual keying does? Not saying it should, just double-checking.
Author
Member

I'd argue no. Auto-keying and manual-keying are two very different concepts and having the Default channels influence auto-keying would be quite annoying I think

I'd argue no. Auto-keying and manual-keying are two very different concepts and having the Default channels influence auto-keying would be quite annoying I think
Member

Makes sense! Thanks for the explanation. :-)

Makes sense! Thanks for the explanation. :-)
nathanvegdahl marked this conversation as resolved
Christoph Lendenfeld added 2 commits 2023-12-12 09:48:35 +01:00
Author
Member

Just to clarify: autokeying still can use keying sets, it just doesn't have to? In other words, this PR brings auto-keying in line with the manual keying changes from the previous PR. If that's the case, I might tweak the PR description to make that clearer:

Yes, the feature of assigning a keying set to auto-keying still exists. It's just all the other functions that don't need to use a keying set have been changed.

> Just to clarify: autokeying still *can* use keying sets, it just doesn't have to? In other words, this PR brings auto-keying in line with the manual keying changes from the previous PR. If that's the case, I might tweak the PR description to make that clearer: Yes, the feature of assigning a keying set to auto-keying still exists. It's just all the other functions that don't need to use a keying set have been changed.
Author
Member

@nathanvegdahl about user review. I am not sure this is useful on this PR since it doesn't change the behavior.
The next one would though #115525: WIP: Anim: Separate keying flags

The reason this doesn't change the behavior is that the keying set system would in turn call the insert keyframe functions again. We are just bypassing that with this PR

@nathanvegdahl about user review. I am not sure this is useful on this PR since it doesn't change the behavior. The next one would though [#115525: WIP: Anim: Separate keying flags](https://projects.blender.org/blender/blender/pulls/115525) The reason this doesn't change the behavior is that the keying set system would in turn call the insert keyframe functions again. We are just bypassing that with this PR
Christoph Lendenfeld requested review from Nathan Vegdahl 2023-12-12 11:02:50 +01:00
Member

@ChrisLend Oh! Got it. Yeah, just tested in current main, and that does indeed seem to be the case. The selected keying set has no influence anyway.

So yeah, I think it's fine to just land. In my testing it indeed doesn't appear to change any behavior.

@ChrisLend Oh! Got it. Yeah, just tested in current main, and that does indeed seem to be the case. The selected keying set has no influence anyway. So yeah, I think it's fine to just land. In my testing it indeed doesn't appear to change any behavior.
Christoph Lendenfeld added 1 commit 2023-12-12 15:14:15 +01:00
Nathan Vegdahl approved these changes 2023-12-12 17:24:38 +01:00
Nathan Vegdahl left a comment
Member

Looks good to me!

Looks good to me!
Christoph Lendenfeld merged commit 92ad16ab90 into main 2023-12-14 09:04:20 +01:00
Christoph Lendenfeld deleted branch autokey_remove_keying_sets 2023-12-14 09:04:22 +01:00
Sign in to join this conversation.
No reviewers
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
Interest: X11
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
No project
No Assignees
2 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#115522
No description provided.