M9.6: text animation UI (Animate:/Add: pop-ups, flattened animator rows, path popup, presets, menus)
Timeline: Text group 'Animate:' and animator 'Add:' pop-ups (properties and Range/Wiggly/Expression selectors), selectors/properties listed directly under each animator, Path Options ▸ Path lists the layer's masks and hides the other path options until one is chosen. Properties panel Add Animator lists every animator property plus Enable Per-character 3D, and a Presets menu. Animation menu: Animate Text, Add Text Selector, Text Animation Presets. Expression Selector result replaces the selection (no Mode); selector popups are non-keyframable like AE. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
c5cf189e1a
commit
fedb5cb715
@@ -91,6 +91,11 @@ pub fn command_specs() -> &'static [CommandSpec] {
|
||||
})
|
||||
}
|
||||
|
||||
/// (id, name) of the text animation presets.
|
||||
pub fn text_preset_list() -> Vec<(String, String)> {
|
||||
text_anim::preset_names()
|
||||
}
|
||||
|
||||
pub fn find(id: &str) -> Option<&'static CommandSpec> {
|
||||
command_specs().iter().find(|c| c.id == id)
|
||||
}
|
||||
|
||||
@@ -17,6 +17,11 @@ fn presets() -> Vec<Value> {
|
||||
serde_json::from_str::<Value>(PRESETS_JSON).ok().and_then(|v| v.get("presets").and_then(Value::as_array).cloned()).unwrap_or_default()
|
||||
}
|
||||
|
||||
/// (id, name) of every preset.
|
||||
pub fn preset_names() -> Vec<(String, String)> {
|
||||
presets().iter().filter_map(|p| Some((p.get("id")?.as_str()?.to_string(), p.get("name")?.as_str()?.to_string()))).collect()
|
||||
}
|
||||
|
||||
/// Enabled when a text layer is selected.
|
||||
fn has_text_layer(s: &Session) -> std::result::Result<(), String> {
|
||||
has_comp(s)?;
|
||||
|
||||
@@ -424,6 +424,11 @@ mod tests_text;
|
||||
mod tests_timeline;
|
||||
|
||||
/// Font families available to text layers (bundled + scanned system fonts).
|
||||
/// Text animation presets: (id, name), for menus.
|
||||
pub fn text_presets() -> Vec<(String, String)> {
|
||||
commands::text_preset_list()
|
||||
}
|
||||
|
||||
pub fn text_families() -> Vec<String> {
|
||||
effectcraft_text::families().into_iter().map(|(f, _)| f).collect()
|
||||
}
|
||||
|
||||
@@ -66,9 +66,11 @@ fn add_property_and_selectors_with_undo_redo() {
|
||||
assert_eq!(matches(sels), ["rangeSelector", "wigglySelector", "expressionSelector", "rangeSelector"]);
|
||||
let names: Vec<&str> = sels.children.iter().map(Node::name).collect();
|
||||
assert_eq!(names, ["Range Selector 1", "Wiggly Selector 1", "Expression Selector 1", "Range Selector 2"]);
|
||||
// Expression selector carries the default amount expression; wiggly defaults to Intersect.
|
||||
// Expression selector carries the default amount expression (and no Mode); wiggly defaults to
|
||||
// Intersect.
|
||||
let ex = sels.group("expressionSelector").unwrap();
|
||||
assert!(ex.get("amount").unwrap().has_expression());
|
||||
assert!(ex.get("mode").is_none());
|
||||
assert_eq!(sels.group("wigglySelector").unwrap().get("mode").unwrap().value, KV::Enum(2));
|
||||
let cid = s.active_comp_id().unwrap();
|
||||
let a1 = s.render(cid, s.time(), Default::default());
|
||||
|
||||
Reference in New Issue
Block a user