M5.13: keyframe paste: several copied layers paste onto as many layers in order; Paste Reversed pastes like Paste

- Keys copied from several layers and pasted onto as many selected layers go first to first,
  second to second, as in After Effects; every target used to receive every copied property
  (the later ones overwriting the earlier).
- Edit ▸ Paste Reversed Keyframes mirrors the clipboard over its span and pastes it through
  `keys.paste`, so it now follows the same rules as Paste: the layer's time stretch, the
  selected target property, Hold-only properties, value conversion and roving keys (its own
  simplified paste ignored them and kept existing keys' easing on a time collision).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
bflatastic
2026-10-05 08:02:16 +07:00
co-authored by Claude Opus 5.5
parent 9ea1f1325d
commit 43bf2906d3
3 changed files with 71 additions and 44 deletions
+9 -1
View File
@@ -73,11 +73,19 @@ fn paste(s: &mut Session, p: &Value) -> Result<Value> {
let path = str_p(p, "path")?;
comp.layer(*targets.first()?)?.props.prop(path).map(|pr| pr.uid)
});
// Keys copied from several layers, pasted onto as many layers: the first copied layer's keys
// go to the first target and so on (else every target gets every copied property).
let mut sources: Vec<LayerId> = clip.iter().map(|c| c.layer).collect();
sources.dedup();
let paired = sources.len() > 1 && sources.len() == targets.len();
// (layer, prop uid, clip index)
let mut plan: Vec<(LayerId, Uid, usize)> = vec![];
for lid in &targets {
for (ti, lid) in targets.iter().enumerate() {
let Some(l) = comp.layer(*lid) else { continue };
for (ci, c) in clip.iter().enumerate() {
if paired && sources.get(ti) != Some(&c.layer) {
continue;
}
let Some(sample) = c.keys.first().map(|k| &k.value) else { continue };
let target = if clip.len() == 1 {
explicit