Refactor: use insert_key_rna()
for button keyframing
#121491
No reviewers
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
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
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
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
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#121491
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "nathanvegdahl/blender:button_keying_uniformity"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This commit does two things:
insert_key_rna()
instead ofinsert_keyframe()
.insert_key_rna()
to accept and understand rna paths thatspecify an array element (for array properties), in order to make
the above possible.
This is part of a progressive refactor that is unifying the keyframing
code to use the same keyframing functions (in particular converging
on
insert_key_rna()
), rather than many different functions withsubtly different behavior.
Notes for reviewers:
insert_key_rna()
to be able to take paths with fully qualified array indices. However, I'm not 100% sold on appending "[##]" to the path string to accomplish that. An alternative is forinsert_key_rna()
to take a span of string + int pairs rather than just a span strings like it does now.insert_key_rna()
will already handle Baklava keying after #120428 lands.insert_key_rna()
for button keyframing 362380fe46Curious what sybren thinks of this, but I like this solution.
It keeps the function interface of
insert_key_rna
really simple.The only thing that is slightly annoying is having to hardcode the
[]
into the string.Yeah, I think this is a perfectly reasonable solution. And I agree that it keeps the interface for
insert_key_rna()
simpler when looking at justinsert_key_rna()
.However, I suspect that in practice it will make
insert_key_rna()
more complicated to call from most places: you usually have the index as an integer, not already embedded in the path string, so this way you have to take the time and code space to append that index to the string before you can callinsert_key_rna()
. Whereas if it's passed as an integer alongside the path, you can just do that directly without any real prep work.Having said that, I think it would be a pretty straightforward refactor going from one to the other, so I don't think it's critical that we get it "right" straight away.
After some discussion about a related refactor with @ChrisLend, I think I'm going to split off the
Modifies insert_key_rna() to accept and understand rna paths that specify an array element
part of this into a separate PR.Edit: here's that PR: #121879
Nathan Vegdahl referenced this pull request2024-05-16 17:07:47 +02:00
@ -1083,3 +1083,2 @@
PropertyRNA *prop = nullptr;
const bool path_resolved = RNA_path_resolve_property(
rna_pointer, rna_path.c_str(), &ptr, &prop);
int index;
I think this is the array index, and if so, please name it
array_index
. That just makes it more concrete.@ -1037,0 +1016,4 @@
* then add the specific index of the element we're keying to end of the
* path. */
std::string real_path = std::move(path.value());
if (!all) {
Given that #121879 has landed in
main
, why is this still necessary?Gah! Yeah, this whole PR is redundant with other stuff that's already landed. Will close.
Everything this PR was trying to do has now been taken care of in #121879 and #122053. So it's no longer needed.
Pull request closed