M13.20: every Timeline property shortcut — double presses AA (Material Options), PP (paint / Roto Brush / Puppet), SS (selected properties), RR (Time Remap), TT (Mask Opacity), MM (all mask properties; a single M now shows Mask Path), FF (missing effects), EE (expressions) next to LL and UU; Alt+Shift+A/P/S/R/T add or remove a keyframe at the current time on every selected layer in one undo step (keys.toggleTransform: separated X/Y/Z Position, Orientation and X/Y/Z Rotation on 3D layers); Ctrl/Cmd+` twirls the selected layers open or closed (from a reveal, their full tree)

This commit is contained in:
bflatastic
2026-10-04 01:10:33 +07:00
parent aef72378f8
commit f9990f7387
5 changed files with 284 additions and 26 deletions
+64 -6
View File
@@ -61,6 +61,14 @@ pub const UI_COMMANDS: &[UiCommand] = &[
uic!("timeline.reveal.masks", "Reveal Masks", [], Some("M")),
uic!("timeline.reveal.feather", "Reveal Mask Feather", [], Some("F")),
uic!("timeline.reveal.levels", "Reveal Audio Levels (press twice: Waveform)", [], Some("L")),
uic!("timeline.reveal.timeRemap", "Reveal Time Remap", [], None),
uic!("timeline.reveal.expressions", "Reveal Expressions", [], None),
uic!("timeline.reveal.maskOpacity", "Reveal Mask Opacity", [], None),
uic!("timeline.reveal.maskPath", "Reveal Mask Path", [], None),
uic!("timeline.reveal.material", "Reveal Material Options", [], None),
uic!("timeline.reveal.paint", "Reveal Paint, Roto Brush and Puppet", [], None),
uic!("timeline.reveal.selected", "Reveal Selected Properties", [], None),
uic!("timeline.reveal.missingEffects", "Reveal Missing Effects", [], None),
uic!("timeline.reveal.waveform", "Reveal Audio Waveform", [], None),
uic!("timeline.revealAdd.position", "Add Position to Revealed Properties", [], Some("Shift+P")),
uic!("timeline.revealAdd.scale", "Add Scale to Revealed Properties", [], Some("Shift+S")),
@@ -77,7 +85,13 @@ pub const UI_COMMANDS: &[UiCommand] = &[
uic!("timeline.search", "Search Timeline", [], None),
uic!("flowchart.options", "Flowchart Options", [], None),
uic!("flowchart.graph", "Flowchart Graph", [], None),
uic!("timeline.collapseAll", "Collapse All", [], Some("Cmd+`")),
uic!("timeline.collapseAll", "Collapse All", [], None),
uic!("timeline.twirlSelected", "Twirl Selected Layers Open / Closed", [], Some("Cmd+`")),
uic!("timeline.keyAt.anchor", "Add or Remove Anchor Point Keyframe", [], Some("Alt+Shift+A")),
uic!("timeline.keyAt.position", "Add or Remove Position Keyframe", [], Some("Alt+Shift+P")),
uic!("timeline.keyAt.scale", "Add or Remove Scale Keyframe", [], Some("Alt+Shift+S")),
uic!("timeline.keyAt.rotation", "Add or Remove Rotation Keyframe", [], Some("Alt+Shift+R")),
uic!("timeline.keyAt.opacity", "Add or Remove Opacity Keyframe", [], Some("Alt+Shift+T")),
uic!("tool.selection", "Selection Tool", [], Some("V")),
uic!("tool.hand", "Hand Tool", [], Some("H")),
uic!("tool.zoom", "Zoom Tool", [], Some("Z")),
@@ -110,12 +124,38 @@ pub fn panel_command_id(p: PanelKind) -> String {
/// The reveal shortcuts (P, S, R, T, A, E, M, F, L…). `add` (Shift+key) adds the property to
/// (or removes it from) those already revealed instead of replacing them.
pub fn reveal(app: &mut EffectcraftApp, kind: &str, now: f64, add: bool) {
// AE's double-press shortcuts: L then L again quickly reveals the Waveform (LL).
let kind = match app.last_reveal.take() {
Some((k, t)) if k == "levels" && kind == "levels" && now - t < 0.6 => "waveform",
_ => kind,
// The double-press shortcuts: the same key again within 0.6 s reveals its second set (LL
// Waveform, TT Mask Opacity, MM all mask properties, EE Expressions, RR Time Remap, AA
// Material Options, PP paint / Roto Brush / Puppet, SS selected properties, FF missing
// effects). A single M shows Mask Path.
let double = |k: &str| -> Option<&'static str> {
Some(match k {
"levels" => "waveform",
"opacity" => "maskOpacity",
"masks" => "masks",
"effects" => "expressions",
"rotation" => "timeRemap",
"anchor" => "material",
"position" => "paint",
"scale" => "selected",
"feather" => "missingEffects",
_ => return None,
})
};
let pressed = kind;
// (With Shift a second press removes the property again instead.)
let again = !add && matches!(app.last_reveal.take(), Some((k, t)) if k == pressed && now - t < 0.6);
app.last_reveal = Some((if again { String::new() } else { pressed.to_string() }, now));
let kind = match (again, double(pressed)) {
(true, Some(d)) => {
// The second press replaces what the first one revealed.
let first = if pressed == "masks" { "maskPath" } else { pressed };
app.ui.timeline.reveal.retain(|k| k != first);
d
}
_ if pressed == "masks" => "maskPath",
_ => pressed,
};
app.last_reveal = Some((kind.to_string(), now));
let tl = &mut app.ui.timeline;
let present = tl.reveal.iter().any(|k| k == kind);
let sel: Vec<u64> = if app.session.state.selected_layers.is_empty() {
@@ -208,6 +248,9 @@ pub fn invoke(app: &mut EffectcraftApp, ctx: &egui::Context, id: &str, params: V
reveal(app, k, now, false);
return Ok(Value::Null);
}
if let Some(k) = id.strip_prefix("timeline.keyAt.") {
return run_engine(app, ctx, "keys.toggleTransform", json!({"prop": k}));
}
if let Some(k) = id.strip_prefix("timeline.revealAdd.") {
reveal(app, k, now, true);
return Ok(json!({"revealed": app.ui.timeline.reveal}));
@@ -358,6 +401,21 @@ pub fn invoke(app: &mut EffectcraftApp, ctx: &egui::Context, id: &str, params: V
app.ui.timeline.open_groups.clear();
app.ui.timeline.reveal.clear();
}
// Ctrl+`: twirl the selected layers open (all closed ones) or closed (all open). From a
// reveal shortcut's view it opens their full property trees.
"timeline.twirlSelected" => {
let sel: Vec<u64> = app.session.state.selected_layers.iter().map(|l| l.0).collect();
let tl = &mut app.ui.timeline;
let revealing = !tl.reveal.is_empty();
tl.reveal.clear();
if !revealing && sel.iter().all(|l| tl.open_layers.contains(l)) {
for l in &sel {
tl.open_layers.remove(l);
}
} else {
tl.open_layers.extend(sel);
}
}
"timeline.workAreaBegin" => return app.session.execute("comp.workArea", json!({"set": "begin"})).map_err(|e| e.to_string()),
"timeline.workAreaEnd" => return app.session.execute("comp.workArea", json!({"set": "end"})).map_err(|e| e.to_string()),
"timeline.moveInToTime" => return timing(app, "moveInToTime"),
+35 -4
View File
@@ -423,6 +423,7 @@ fn prop_visible(p: &Property, layer: &Layer) -> bool {
fn reveal_matches(p: &Property, path_matches: &[&str], kind: &str) -> bool {
match kind {
"animated" => p.is_animated() || p.has_expression(),
"expressions" => p.has_expression(),
_ => path_matches.contains(&p.match_id.as_str()),
}
}
@@ -497,8 +498,11 @@ fn reveal_targets(kind: &str) -> Option<(&'static str, &'static [&'static str])>
"opacity" => ("transform", &["opacity"]),
"anchor" => ("transform", &["anchor"]),
"feather" => ("masks", &["feather"]),
"maskPath" => ("masks", &["path"]),
"maskOpacity" => ("masks", &["opacity"]),
"levels" => ("audio", &["levels"]),
"animated" => ("", &[]),
"timeRemap" => ("", &["timeRemap"]),
"animated" | "expressions" => ("", &[]),
_ => return None,
})
}
@@ -620,6 +624,28 @@ fn reveal_rows(app: &EffectcraftApp, l: &Layer, rows: &mut Vec<Row>) {
{
group_rows(rows, fx, true);
}
// PP: paint, Roto Brush and Puppet effects; FF: effects whose plug-in is missing.
for (k, keep) in [
("paint", &(|id: &str| matches!(id, "ec.paint.paint" | "ec.matte.rotobrush" | "ec.distort.puppet")) as &dyn Fn(&str) -> bool),
("missingEffects", &|id: &str| effectcraft_engine::effects::find(id).is_none()),
] {
if has(k)
&& let Some(fx) = l.effects()
{
let mut only = fx.clone();
only.children.retain(|c| matches!(c, Node::Group(g) if matches!(&g.kind, GroupKind::Effect { effect } if keep(effect))));
group_rows(rows, &only, true);
}
}
// AA: Material Options (3D layers).
if has("material")
&& let Some(m) = l.props.sub("materialOptions")
&& l.is_3d()
{
let mut only = PropGroup::new(0, "", "");
only.children.push(Node::Group(m.clone()));
group_rows(rows, &only, false);
}
// P/S/R/T/A/F/L/animated: matching properties, in tree order, each once.
let mut wanted = std::collections::BTreeSet::new();
for kind in &tl.reveal {
@@ -640,7 +666,12 @@ fn reveal_rows(app: &EffectcraftApp, l: &Layer, rows: &mut Vec<Row>) {
collect_props(&l.props, &mut found, &|p| wanted.contains(&p.uid));
rows.extend(found.into_iter().map(|uid| Row { layer: l.id, depth: 1, kind: RowKind::Prop { uid } }));
}
if has("props") {
// SS: the selected properties and groups (as Animation ▸ Reveal Properties shows them).
let selected: std::collections::BTreeSet<u64> = app.session.state.selected_props.iter().filter(|(lid, _)| *lid == l.id).map(|(_, u)| *u).collect();
if has("props") || has("selected") {
let picked: std::collections::BTreeSet<u64> =
if has("props") { tl.reveal_props.iter().copied().chain(selected.iter().copied().filter(|_| has("selected"))).collect() } else { selected };
let reveal_props = &picked;
// Animation ▸ Reveal Properties…: the engine picked the uids.
fn groups_in<'a>(g: &'a PropGroup, set: &std::collections::BTreeSet<u64>, out: &mut Vec<&'a PropGroup>) {
for sg in g.groups() {
@@ -652,7 +683,7 @@ fn reveal_rows(app: &EffectcraftApp, l: &Layer, rows: &mut Vec<Row>) {
}
}
let mut groups = vec![];
groups_in(&l.props, &tl.reveal_props, &mut groups);
groups_in(&l.props, reveal_props, &mut groups);
for g in groups {
let open = tl.open_groups.contains(&g.uid);
rows.push(Row {
@@ -665,7 +696,7 @@ fn reveal_rows(app: &EffectcraftApp, l: &Layer, rows: &mut Vec<Row>) {
}
}
let mut found = vec![];
collect_props(&l.props, &mut found, &|p| prop_visible(p, l) && tl.reveal_props.contains(&p.uid) && !wanted.contains(&p.uid));
collect_props(&l.props, &mut found, &|p| prop_visible(p, l) && reveal_props.contains(&p.uid) && !wanted.contains(&p.uid));
rows.extend(found.into_iter().map(|uid| Row { layer: l.id, depth: 1, kind: RowKind::Prop { uid } }));
}
if has("waveform")