M14.5: wire the remaining settings; keyframe assistants and labels; AE menu entries
Settings: 56 of 59 not-yet-wired settings now change behaviour (nested-comp switches, constant vertex count, related-item time sync, match-name pick whip, split-layer order, Home on open, motion path span, internal wireframes, zoom quality, label-coloured tabs, mask colour cycling, gradients, grid/guide styles, text engine, font preview/recent/native names, missing frames, unlabeled alpha, drag import, default output folder, segmenting, bit depth names, preview sample rate, disk/media/conformed-audio caches, RAM reserve and low-memory reduction, Video Preview window, 3D reference axes/extended viewer/draft shadows, script file gate + File.execute warning, expression editor options and error banner). Three stay display-only and are documented. Features: Convert Audio to Keyframes, RPF Camera Import (JSON/CSV camera data), keyframe colour labels + Select Keyframe Label Group, Recent Animation Presets. Menus: Edit > History, File > Import Recent Footage, Replace Footage > With Layered Comp, Save a Copy As XML (.ecprojx, opens again), Composition > VR (Create VR Environment, Extract Cubemap), Assign Shortcut to 3D view / workspace, Window viewer labels + open viewers, Help > System Compatibility Report / Enable Logging / Reveal Logging File. Dynamic menu nodes (@dynamic:…) shared by the egui and native menus. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
5df98d0982
commit
f855a4b55b
+76
-20
@@ -746,6 +746,37 @@ pub fn frontend(app: &mut EffectcraftApp, ctx: &egui::Context, id: &str, p: Valu
|
||||
app.show_panel(PanelKind::Layer);
|
||||
Value::Null
|
||||
}
|
||||
"app.confirmExecute" => {
|
||||
// Settings ▸ Scripting ▸ Warn User When Executing Files.
|
||||
let path = p.get("path").and_then(Value::as_str).unwrap_or_default().to_string();
|
||||
crate::panels::forms::form(
|
||||
app,
|
||||
"A script wants to open a file",
|
||||
"file.executeFile",
|
||||
json!({"path": path, "confirmed": true}),
|
||||
vec![crate::panels::forms::Field::text("path", "Open", &path)],
|
||||
);
|
||||
Value::Null
|
||||
}
|
||||
"app.showReport" => {
|
||||
let title = p.get("title").and_then(Value::as_str).unwrap_or("Report").to_string();
|
||||
let text = p.get("text").and_then(Value::as_str).unwrap_or_default().to_string();
|
||||
crate::panels::dialogs::info(app, &title, &text);
|
||||
Value::Null
|
||||
}
|
||||
"window.assignWorkspaceShortcut" => {
|
||||
let mut q = p.clone();
|
||||
q["workspace"] = json!(app.ui.workspace);
|
||||
return run_engine(app, ctx, "window.assignWorkspaceShortcut", q);
|
||||
}
|
||||
"file.interpretFootage" => {
|
||||
// Import ▸ Interpret Unlabeled Alpha As: Ask User.
|
||||
if let Some(i) = p.get("item").and_then(Value::as_u64) {
|
||||
app.session.state.project_selection = vec![effectcraft_engine::project::ItemId(i)];
|
||||
}
|
||||
crate::panels::dialogs::open_form(app, "file.interpretFootage", &json!({}));
|
||||
Value::Null
|
||||
}
|
||||
"effect.manage" | "anim.browsePresets" => {
|
||||
app.show_panel(PanelKind::EffectsPresets);
|
||||
Value::Null
|
||||
@@ -786,6 +817,8 @@ fn file_dialog(app: &mut EffectcraftApp, id: &str, params: &Value) -> Option<Res
|
||||
"file.runScript" => ("path", Ask::Open(&["jsx", "js", "jsonl", "json", "txt"])),
|
||||
"file.replaceFootage" => ("path", Ask::Import),
|
||||
"file.collectFiles" => ("folder", Ask::Save("Collected Files")),
|
||||
"file.saveCopyAsXml" => ("path", Ask::Save("Untitled Project.ecprojx")),
|
||||
"keys.rpfCameraImport" => ("path", Ask::Open(&["json", "csv", "txt"])),
|
||||
_ => return None,
|
||||
};
|
||||
if params.get(key).is_some()
|
||||
@@ -862,6 +895,15 @@ pub(crate) fn entry_label(app: &EffectcraftApp, e: &MenuEntry) -> String {
|
||||
match e.command.as_str() {
|
||||
"edit.undo" => app.session.history.undo.last().map(|u| format!("Undo {}", u.0)).unwrap_or_else(|| "Can't Undo".into()),
|
||||
"edit.redo" => app.session.history.redo.last().map(|u| format!("Redo {}", u.0)).unwrap_or_else(|| "Can't Redo".into()),
|
||||
// Window ▸ Layer: the layer open in the Layer panel.
|
||||
"window.panel" if e.params.get("panel").and_then(Value::as_str) == Some("layer") => {
|
||||
let name = app
|
||||
.ui
|
||||
.layer_panel
|
||||
.and_then(|id| app.session.active_comp().and_then(|c| c.layer(effectcraft_engine::project::LayerId(id))))
|
||||
.map(|l| l.name.clone());
|
||||
format!("Layer: {}", name.unwrap_or_else(|| "(none)".into()))
|
||||
}
|
||||
_ => effectcraft_engine::menus::entry_label(&app.session, e),
|
||||
}
|
||||
}
|
||||
@@ -1126,29 +1168,38 @@ fn menu_nodes(app: &mut EffectcraftApp, ui: &mut egui::Ui, nodes: &[MenuNode], c
|
||||
MenuNode::Separator => {
|
||||
ui.separator();
|
||||
}
|
||||
MenuNode::Submenu { label, children } if label == "Open Recent" => {
|
||||
// File ▸ Open Recent: the recent projects (Settings), then the static entries.
|
||||
ui.menu_button((gutter(false), label.as_str()), |ui| {
|
||||
ui.set_min_width(320.0);
|
||||
let recent = app.session.prefs.recent_projects.clone();
|
||||
if recent.is_empty() {
|
||||
ui.add_enabled(false, egui::Button::new((gutter(false), "No Recent Projects")));
|
||||
MenuNode::Dynamic { name } => {
|
||||
// Recent projects / footage / presets, undo history, shortcut slots, viewers.
|
||||
let ws = app.ui.workspace.clone();
|
||||
let (entries, empty) = effectcraft_engine::menus::dynamic(&app.session, name, &dyn_ctx(&ws));
|
||||
if entries.is_empty()
|
||||
&& let Some(e) = empty
|
||||
{
|
||||
ui.add_enabled(false, egui::Button::new((gutter(false), e)));
|
||||
}
|
||||
for (i, e) in entries.iter().enumerate() {
|
||||
let tip = match name.as_str() {
|
||||
"recentProjects" => app.session.prefs.recent_projects.get(i).cloned(),
|
||||
"recentFootage" => app.session.prefs.recent_footage.get(i).cloned(),
|
||||
"recentPresets" => app.session.prefs.recent_presets.get(i).cloned(),
|
||||
_ => None,
|
||||
};
|
||||
let r = ui.add_enabled(entry_enabled(app, e), egui::Button::new((gutter(false), e.label.as_str())));
|
||||
let r = match &tip {
|
||||
Some(t) => r.on_hover_text(t),
|
||||
None => r,
|
||||
};
|
||||
app.auto.add(&format!("menu.{name}.{i}"), r.rect, &e.label);
|
||||
if r.clicked() {
|
||||
*clicked = Some((e.command.clone(), e.params.clone()));
|
||||
ui.close();
|
||||
}
|
||||
for (i, path) in recent.iter().enumerate() {
|
||||
let name = std::path::Path::new(path).file_name().map(|n| n.to_string_lossy().to_string()).unwrap_or(path.clone());
|
||||
let r = ui.add(egui::Button::new((gutter(false), name))).on_hover_text(path);
|
||||
app.auto.add(&format!("menu.openRecent.{i}"), r.rect, path);
|
||||
if r.clicked() {
|
||||
*clicked = Some(("file.openRecent".into(), json!({"index": i})));
|
||||
ui.close();
|
||||
}
|
||||
}
|
||||
ui.separator();
|
||||
menu_nodes(app, ui, children, clicked);
|
||||
});
|
||||
}
|
||||
}
|
||||
MenuNode::Submenu { label, children } => {
|
||||
ui.menu_button((gutter(false), label.as_str()), |ui| {
|
||||
let ws = app.ui.workspace.clone();
|
||||
let shown = effectcraft_engine::menus::submenu_label(&app.session, label, &dyn_ctx(&ws));
|
||||
ui.menu_button((gutter(false), shown.as_str()), |ui| {
|
||||
ui.set_min_width(if children.len() > 30 { 200.0 } else { 240.0 });
|
||||
// Long submenus (Blending Mode, effect categories) scroll instead of running
|
||||
// off the screen.
|
||||
@@ -1166,6 +1217,11 @@ fn menu_nodes(app: &mut EffectcraftApp, ui: &mut egui::Ui, nodes: &[MenuNode], c
|
||||
}
|
||||
}
|
||||
|
||||
/// Frontend state for dynamic menus (the current workspace).
|
||||
pub(crate) fn dyn_ctx(workspace: &str) -> effectcraft_engine::menus::DynCtx<'_> {
|
||||
effectcraft_engine::menus::DynCtx { workspace: Some(workspace) }
|
||||
}
|
||||
|
||||
/// The check-mark column every menu row reserves (like macOS / After Effects menus).
|
||||
fn gutter(checked: bool) -> egui::Atom<'static> {
|
||||
use egui::AtomExt;
|
||||
|
||||
Reference in New Issue
Block a user