This is a draft for a design for copy-pasting keyframes in the Action editor. The main goal is to add the necessary changes for working with slotted Actions.
Note
These two don't mix very well:
This list of behaviours can be roughly be broken down into the following categories:
What I (Sybren) was able to figure out of the current code, these use cases are supported:
When pasting, the copied F-Curves are matched to the target F-Curves, using increasingly accepting rule sets. If a rule set matches at least one curve, the following rule sets are ignored.
pose.bones["name"].location
) + array index. The name can be flipped when animating bones and flipping is requested.location
when the copied data path was pose.bones["name"].location
. Plus the array index.Depending on how many curves were copied from, and how many curves were copied to, there are exceptions to the above:
Blender follows this pseudo-code when pasting:
This means that slots are completely ignored, and that thus all slots receive the copied data (if they have matching F-Curves, which is likely when animating two similarly rigged characters).
Needs good list of use cases.
These two may interfere with each other, we should pick one:
Probably 1. is better, as 2. only works for objects (so wouldn't be able to paste object curves to material slot).
Big question: how does this interact with the matching rules that are already in Blender?
It's probably the best to create multiple paste operators. Those can then be shown as a choice in a popup (like the Ctrl+P for parenting) or a pie menu, or people can directly bind them to the hotkeys they want.
Pasting should only happen to visible F-Curves.
Pasting should only happen to valid F-Curves. When pasting from one rig to another, this should skip animation of bones that do not exist in the target rig.
Selection is a bit borken. Selecting a group does not select the F-Curves in it, so it's hard to select all F-Curves in a range. You have to expand all the groups before range-selecting.
This chapter describes how the copy-pasting of animation keys works in the Action editor.
Since some parts of the behavior are determined by what was copied, and other parts depend on what is selected when pasting, colors are used to distinguish between those:
Copy-Paste of animation keys in the Action editor works as follows:
Note that pasting should never:
The diagram below describes how target F-Curves (i.e. the ones being pasted into) are chosen, and how they are matched to the copied keyframes.
The following shorthand is used:
R
: RNA data path of the F-Curve (like pose.bones["Root"].location
)I
: Array Index of the F-Curve (like 1
for the Y-location).N
: The identifier of the property the F-Curve animates (like location
).Combinations are concatenated, so RI
means the combination of (RNA path, array index).
The "Degrade" behavior works as follows. The first rule that matches anything "wins", and in that case subsequent rules are not visited any more.
RI
: Exact match on (RNA data path, array index). So if you copied from (pose.bones["Root"].location, 1
) and that is among the selected F-Curves too, this rule matches.NI
: Match (property name, array index). So in the above example, it would also match if you have pose.bones["Arm_L"].location
selected.I
: Match only the array index. So if you have Location X/Y/Z copied, and selected an "Y thing", it will paste the Y location keys there.The diagram below describes how the target slot is chosen when pasting.