Skip to content

EffectCraft: An open-source motion graphics and compositing tool written by scratch in pure Rust

Merge pull request #1021 from pravdomil/claude/uu-effect-params

Brandon Thomasf9d6457f6ad0
diff --cc crates/ui-egui/src/panels/timeline.rs
index 4f7bb40ec,2e7d35e53..af02a5e0e
--- a/crates/ui-egui/src/panels/timeline.rs
+++ b/crates/ui-egui/src/panels/timeline.rs
@@@ -3368,24 -3117,7 +3382,22 @@@ pub fn show(app: &mut EffectcraftApp, u
}
}
}
- UiAct::ToggleGroup(layer, uid) => app.ui.timeline.toggle_group(layer, uid),
+ UiAct::ToggleGroup(layer, uid, all) => {
+ let tl = &mut app.ui.timeline;
- let open = !tl.open_groups.remove(&uid);
- if open {
- tl.open_groups.insert(uid);
- }
++ tl.toggle_group(layer, uid);
++ let open = tl.open_groups.contains(&uid);
+ if all && let Some(g) = comp.layer(LayerId(layer)).and_then(|l| find_group(&l.props, uid)) {
+ let mut uids = vec![];
+ walk_groups(g, &mut uids);
+ for u in uids {
+ if open {
+ tl.open_groups.insert(u);
+ } else {
+ tl.open_groups.remove(&u);
+ }
+ }
+ }
+ }
UiAct::SetTime(tt) => app.session.set_time(tt),
UiAct::EndMerge => app.session.history.merge_key = None,
UiAct::ChangeRenderer => {
diff --cc crates/ui-egui/src/state.rs
index 830cd75c7,a73e25cfc..b8ecb8c08
--- a/crates/ui-egui/src/state.rs
+++ b/crates/ui-egui/src/state.rs
@@@ -320,17 -316,20 +321,29 @@@ impl TimelineState
}
self.reveal = kinds;
}
+
+ /// Twirl group `uid` of `layer` by hand. Opened under a reveal, it shows all its properties
+ /// (collapse and expand an effect that shows only its revealed parameters to see them all).
+ pub fn toggle_group(&mut self, layer: u64, uid: u64) {
+ if self.open_groups.remove(&uid) {
+ return;
+ }
+ self.open_groups.insert(uid);
+ if self.layer_reveal.contains_key(&layer) {
+ self.full_groups.entry(layer).or_default().insert(uid);
+ }
+ }
}
+/// Where a Timeline shortcut scrolls to.
+#[derive(Clone, Copy, Debug, PartialEq)]
+pub enum ScrollTo {
+ /// D: the current time, centred in the time graph.
+ Time,
+ /// X: the topmost selected layer, at the top of the layers.
+ Layer,
+}
+
#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct TimelineState {
/// Visible span start (seconds) and pixels per second; None = fit comp.