#1510: Behaviors animation presets (22 original, expression-driven)

Problem: the built-in animation preset library had no Behaviors category
(gap 7: 54 presets against After Effects' 621).

Fix: 22 original Behaviors presets in crates/engine/presets/behaviors.json:
Soft Wiggle, Shake, Float, Sway, Orbit, Figure Eight, Bouncing Ball, Drift
Right, Drift Diagonal, Pendulum, Wobble, Spin Slow, Spin Fast, Pulse,
Heartbeat, Breathe, Rubber Band, Jitter Scale, Blink, Strobe, Flicker, Fade
Pulse. Each puts a time-based expression on one transform property or
opacity (no effects), built on the property's own value so it keeps running
for the layer's whole duration. Listed under * Animation Presets > Behaviors.
Sidecar, ATTRIBUTION.md, gaps.md row 7 and parity docs updated.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
vangel76
2026-10-15 01:46:38 +02:00
co-authored by Claude Sonnet 5.5
parent 05955c08b4
commit f2b0998390
9 changed files with 327 additions and 8 deletions
+2
View File
@@ -69,6 +69,8 @@ Screenshots of EffectCraft itself, rendered headlessly, showing only procedurall
`crates/engine/presets/transitions.json` (sidecar `.attribution`).
- Backgrounds animation presets (23: drifting gradients, fog, cloud and smoke, plasma and magma, cells and crystals, scrolling grids
and checks, pulse rings, bokeh, light sweep): `crates/engine/presets/backgrounds.json` (sidecar `.attribution`).
- Behaviors animation presets (22: wiggle, shake, float, orbit, bounce, drift, pendulum, spin, pulse, heartbeat, blink, strobe, flicker):
`crates/engine/presets/behaviors.json` (sidecar `.attribution`).
- Sample scripts (File ▸ Scripts) and ScriptUI panel: `crates/engine/scripts/Rename Layers.jsx`,
`crates/engine/scripts/Sort Layers by In Point.jsx`, `crates/engine/scripts/Create Null at Selected Layers.jsx`,
`crates/engine/scripts/Render Queue Batch.jsx`, `crates/engine/scripts/ScriptUI Panels/Layer Tools.jsx`
+248
View File
@@ -0,0 +1,248 @@
{
"format": "effectcraft.animationPresets/1",
"notes": "Original EffectCraft behavior presets (MIT OR Apache-2.0), written from scratch. Each one drives a transform property or opacity with a time-based expression built on the property's own value, so the motion runs for the layer's whole duration and still follows the property's keyframes. Apply to any layer; no effects are added.",
"presets": [
{
"id": "wiggleSoft",
"name": "Soft Wiggle",
"category": "Behaviors",
"description": "The layer wanders gently around its position.",
"layer": {
"expr": {
"transform/position": "var w = wiggle(1.2, 30); [w[0], w[1]]"
}
}
},
{
"id": "shake",
"name": "Shake",
"category": "Behaviors",
"description": "A fast, tight shake of the layer's position.",
"layer": {
"expr": {
"transform/position": "var w = wiggle(14, 12); [w[0], w[1]]"
}
}
},
{
"id": "floatUpDown",
"name": "Float",
"category": "Behaviors",
"description": "The layer bobs up and down like it floats on water.",
"layer": {
"expr": {
"transform/position": "[value[0]+(0), value[1]+(Math.sin(time*2)*18)]"
}
}
},
{
"id": "sway",
"name": "Sway",
"category": "Behaviors",
"description": "The layer sways left and right.",
"layer": {
"expr": {
"transform/position": "[value[0]+(Math.sin(time*1.6)*40), value[1]+(0)]"
}
}
},
{
"id": "orbit",
"name": "Orbit",
"category": "Behaviors",
"description": "The layer travels round a circle around its position.",
"layer": {
"expr": {
"transform/position": "[value[0]+(Math.cos(time*2)*80), value[1]+(Math.sin(time*2)*80)]"
}
}
},
{
"id": "figureEight",
"name": "Figure Eight",
"category": "Behaviors",
"description": "The layer traces a figure eight around its position.",
"layer": {
"expr": {
"transform/position": "[value[0]+(Math.sin(time*1.5)*100), value[1]+(Math.sin(time*3)*45)]"
}
}
},
{
"id": "bouncingBall",
"name": "Bouncing Ball",
"category": "Behaviors",
"description": "The layer bounces up from its position again and again.",
"layer": {
"expr": {
"transform/position": "[value[0]+(0), value[1]+(-Math.abs(Math.sin(time*3.2))*140)]"
}
}
},
{
"id": "driftRight",
"name": "Drift Right",
"category": "Behaviors",
"description": "The layer drifts steadily to the right.",
"layer": {
"expr": {
"transform/position": "[value[0]+(time*40), value[1]+(0)]"
}
}
},
{
"id": "driftDiagonal",
"name": "Drift Diagonal",
"category": "Behaviors",
"description": "The layer drifts slowly down and to the right.",
"layer": {
"expr": {
"transform/position": "[value[0]+(time*30), value[1]+(time*18)]"
}
}
},
{
"id": "pendulum",
"name": "Pendulum",
"category": "Behaviors",
"description": "The layer swings like a pendulum.",
"layer": {
"expr": {
"transform/rotation": "value + Math.sin(time*2.4)*25"
}
}
},
{
"id": "wobble",
"name": "Wobble",
"category": "Behaviors",
"description": "The layer rotates with an irregular wobble.",
"layer": {
"expr": {
"transform/rotation": "wiggle(2, 10)"
}
}
},
{
"id": "spinSlow",
"name": "Spin Slow",
"category": "Behaviors",
"description": "The layer rotates once every ten seconds.",
"layer": {
"expr": {
"transform/rotation": "value + time*36"
}
}
},
{
"id": "spinFast",
"name": "Spin Fast",
"category": "Behaviors",
"description": "The layer rotates twice a second.",
"layer": {
"expr": {
"transform/rotation": "value + time*720"
}
}
},
{
"id": "pulse",
"name": "Pulse",
"category": "Behaviors",
"description": "The layer swells and shrinks smoothly.",
"layer": {
"expr": {
"transform/scale": "[value[0]*(1+0.12*Math.sin(time*4)), value[1]*(1+0.12*Math.sin(time*4))]"
}
}
},
{
"id": "heartbeat",
"name": "Heartbeat",
"category": "Behaviors",
"description": "Two quick beats, then a rest, repeating every second.",
"layer": {
"expr": {
"transform/scale": "var t = time % 1; var b = t < 0.3 ? Math.sin(t/0.3*Math.PI) : (t < 0.6 ? 0.7*Math.sin((t-0.3)/0.3*Math.PI) : 0); var k = 1 + 0.2*b; [value[0]*k, value[1]*k]"
}
}
},
{
"id": "breathe",
"name": "Breathe",
"category": "Behaviors",
"description": "The layer slowly grows and settles back.",
"layer": {
"expr": {
"transform/scale": "[value[0]*(1+0.06*Math.sin(time*1.1)), value[1]*(1+0.06*Math.sin(time*1.1))]"
}
}
},
{
"id": "rubberBand",
"name": "Rubber Band",
"category": "Behaviors",
"description": "Width and height stretch against each other.",
"layer": {
"expr": {
"transform/scale": "[value[0]*(1+0.15*Math.sin(time*5)), value[1]*(1-0.15*Math.sin(time*5))]"
}
}
},
{
"id": "jitterScale",
"name": "Jitter Scale",
"category": "Behaviors",
"description": "The layer's size jitters randomly.",
"layer": {
"expr": {
"transform/scale": "var w = wiggle(8, 6); [w[0], w[1]]"
}
}
},
{
"id": "blink",
"name": "Blink",
"category": "Behaviors",
"description": "The layer switches on and off twice a second.",
"layer": {
"expr": {
"transform/opacity": "(Math.floor(time*4) % 2 === 0) ? value : 0"
}
}
},
{
"id": "strobe",
"name": "Strobe",
"category": "Behaviors",
"description": "The layer flashes on for a few frames each beat.",
"layer": {
"expr": {
"transform/opacity": "((time*6) % 1 < 0.25) ? value : 0"
}
}
},
{
"id": "flicker",
"name": "Flicker",
"category": "Behaviors",
"description": "The layer's opacity flickers like a failing lamp.",
"layer": {
"expr": {
"transform/opacity": "var w = wiggle(14, 45); Math.max(0, Math.min(100, w))"
}
}
},
{
"id": "fadePulse",
"name": "Fade Pulse",
"category": "Behaviors",
"description": "Opacity breathes between full and a third.",
"layer": {
"expr": {
"transform/opacity": "value*(0.67+0.33*Math.sin(time*2.5))"
}
}
}
]
}
@@ -0,0 +1,7 @@
asset: behaviors.json
title: EffectCraft Behaviors animation presets (Soft Wiggle, Shake, Float, Sway, Orbit, Figure Eight, Bouncing Ball, Drift Right, Drift Diagonal, Pendulum, Wobble, Spin Slow, Spin Fast, Pulse, Heartbeat, Breathe, Rubber Band, Jitter Scale, Blink, Strobe, Flicker, Fade Pulse)
author: EffectCraft contributors
source: original work
license: MIT OR Apache-2.0
added: 2026-10-15 by vangel76 (Claude Code agent, gap 7, #1510)
notes: Expressions and values written from scratch for EffectCraft on its own transform properties and expression engine; not derived from any Adobe preset (.ffx) or its values.
+7 -2
View File
@@ -1,6 +1,7 @@
//! EffectCraft's own animation preset library (Effects & Presets ▸ * Animation Presets): the
//! Transitions category (original presets built on our Transition effects and layer opacity) and
//! the Backgrounds category (generators, noise and colour effects driven by expressions).
//! the Backgrounds category (generators, noise and colour effects driven by expressions) and the
//! Behaviors category (transform and opacity driven by expressions, no effects).
//!
//! Each preset adds effects (with values and keyframes) and/or keys layer properties, starting
//! at the current time, on every selected layer. The library is data
@@ -26,13 +27,17 @@ pub const TRANSITIONS_JSON: &str = include_str!("../../presets/transitions.json"
/// The original background presets (`presets/backgrounds.json`).
pub const BACKGROUNDS_JSON: &str = include_str!("../../presets/backgrounds.json");
/// The original behavior presets (`presets/behaviors.json`): expression-driven motion on a layer's
/// transform and opacity, no effects.
pub const BEHAVIORS_JSON: &str = include_str!("../../presets/behaviors.json");
/// Keys per animated property, so a hostile inline preset can't allocate without bound.
const MAX_KEYS: usize = 256;
/// Longest expression text an inline preset may carry.
const MAX_EXPR: usize = 4096;
fn presets() -> Vec<Value> {
[TRANSITIONS_JSON, BACKGROUNDS_JSON]
[TRANSITIONS_JSON, BACKGROUNDS_JSON, BEHAVIORS_JSON]
.iter()
.flat_map(|src| serde_json::from_str::<Value>(src).ok().and_then(|v| v.get("presets").and_then(Value::as_array).cloned()).unwrap_or_default())
.collect()
+28 -2
View File
@@ -78,7 +78,7 @@ fn transition_preset_by_name_and_bad_input() {
#[test]
fn preset_catalogue_is_unique_and_categorised() {
let all = crate::animation_presets();
let known = ["Transitions", "Backgrounds"];
let known = ["Transitions", "Backgrounds", "Behaviors"];
let mut ids = std::collections::HashSet::new();
let mut names = std::collections::HashSet::new();
for (id, name, cat) in &all {
@@ -90,7 +90,7 @@ fn preset_catalogue_is_unique_and_categorised() {
assert!(!ids.contains(&id.to_lowercase()) && !names.contains(&name.to_lowercase()), "text preset {id} clashes");
}
let n = |c: &str| all.iter().filter(|(_, _, k)| k == c).count();
assert!(n("Backgrounds") >= 15 && n("Transitions") >= 20);
assert!(n("Backgrounds") >= 15 && n("Transitions") >= 20 && n("Behaviors") >= 20);
}
#[test]
@@ -126,3 +126,29 @@ fn preset_expressions_and_point_fractions() {
assert_eq!(ramp.prop("end").unwrap().value, effectcraft_keyframe::Value::Vec2([80.0, 90.0]));
assert_eq!(ramp.prop("startColor").unwrap().keys.len(), 2);
}
/// #1510: Behaviors presets add no effects; each puts an enabled expression on a transform
/// property, and undo removes it again.
#[test]
fn every_behavior_preset_applies_and_undoes() {
let (mut s, solid) = session();
let list = s.execute("anim.builtinPresets", json!({"category": "Behaviors"})).unwrap();
let list = list.as_array().unwrap().clone();
assert!(list.len() >= 20, "{}", list.len());
let driven = |s: &Session| {
let l = &s.active_comp().unwrap().layers[0];
["transform/position", "transform/scale", "transform/rotation", "transform/opacity"]
.iter()
.filter(|p| l.props.prop(p).is_some_and(|pr| pr.has_expression()))
.count()
};
for p in &list {
let id = p["id"].as_str().unwrap();
let r = s.execute("anim.applyBuiltinPreset", json!({"layers": [solid], "preset": id})).unwrap();
assert_eq!(r["skipped"], json!([]), "{id}: every path and expression applies");
assert_eq!(r["effects"], json!([]), "{id}: behaviors add no effects");
assert_eq!(driven(&s), 1, "{id}: exactly one property is driven");
s.execute("edit.undo", json!({})).unwrap();
assert_eq!(driven(&s), 0, "{id}: undo removes the expression");
}
}
+31
View File
@@ -58,3 +58,34 @@ fn every_background_preset_renders_moves_and_undoes() {
assert_eq!(fx, 0, "{id}: undo removes the effects");
}
}
/// #1510: each Behaviors preset keeps its layer moving (position, scale, rotation or opacity
/// changes over time) and renders finite, deterministic frames.
#[test]
fn every_behavior_preset_renders_and_moves() {
let mut s = effectcraft_host::session();
s.execute("comp.new", json!({"name": "BH", "width": 160, "height": 90, "frameRate": 30, "duration": 8})).unwrap();
// A small white square in the middle so position, scale and rotation changes are visible.
let solid = s.execute("layer.newSolid", json!({"name": "S", "color": "#ffffff", "width": 60, "height": 60})).unwrap()["layer"].as_u64().unwrap();
let list = s.execute("anim.builtinPresets", json!({"category": "Behaviors"})).unwrap();
let list = list.as_array().unwrap().clone();
assert!(list.len() >= 20, "{}", list.len());
for p in &list {
let id = p["id"].as_str().unwrap();
s.execute("time.set", json!({"time": 0.0})).unwrap();
let r = s.execute("anim.applyBuiltinPreset", json!({"layers": [solid], "preset": id})).unwrap();
assert_eq!(r["skipped"], json!([]), "{id}");
let mut frames = Vec::new();
// Times chosen off the periods of every preset so no two samples coincide.
for t in [0.03, 0.13, 0.41, 0.97, 1.73] {
let (px, _, _, nan) = frame(&s, t);
assert!(!nan, "{id} @ {t}: NaN or infinite pixel");
let (again, ..) = frame(&s, t);
assert!(px == again, "{id} @ {t}: render is not deterministic");
frames.push(px);
}
let moved = (1..frames.len()).any(|i| diff(&frames[0], &frames[i]) > 20.0);
assert!(moved, "{id}: the layer does not move ({:?})", (1..frames.len()).map(|i| diff(&frames[0], &frames[i])).collect::<Vec<_>>());
s.execute("edit.undo", json!({})).unwrap();
}
}
+2 -2
View File
@@ -16,7 +16,7 @@ After Effects', and does the preset library exist. The per-effect catalogue is t
| On the GPU | **280** (92%) | Measured: registry flags; GPU vs CPU agreement tested per effect |
| 32-bit float, no clamping | 306 | Measured: registry flags |
| **Rendered output matches After Effects** | **unmeasured** | No effect is compared with an After Effects render yet. `effectcraft_effects::fidelity::compare_frames` exists for the corpus ([fidelity/README.md](fidelity/README.md)); simulation effects are pinned by golden hashes of our own output (M13.27) |
| Animation presets | **54** original presets (8 text-animator, 23 Transitions, 23 Backgrounds) against After Effects' **621** `.ffx` presets | Measured: `crates/engine/presets/text_animators.json`, `crates/engine/presets/transitions.json`, `crates/engine/presets/backgrounds.json`; the After Effects `Presets` folder |
| Animation presets | **76** original presets (8 text-animator, 23 Transitions, 23 Backgrounds, 22 Behaviors) against After Effects' **621** `.ffx` presets | Measured: `crates/engine/presets/text_animators.json`, `crates/engine/presets/transitions.json`, `crates/engine/presets/backgrounds.json`, `crates/engine/presets/behaviors.json`; the After Effects `Presets` folder |
| 26.x additions | Curl Noise (26.3) present (#463 open); effect colour labels (26.5) present in Effect Controls only, not in the Timeline; the rebuilt Effect Controls (26.5) missing | Release notes |
**Breadth ≈ 85%** (presets weigh in; the effects themselves are ≈ 100%). **Ready ≈ 40%**: until a
@@ -56,7 +56,7 @@ implemented under a generic name ("Key Light").
**≈ 70–130 h**: a fidelity corpus case per effect at default and one non-default setting, compared
with After Effects renders, and the fixes they turn up (40–80 h, most of it parallel, but every
reference render needs After Effects on the owner's Mac); an original preset library covering
After Effects' preset categories (Behaviors, Shapes, Synthetics, Text, Image effects remain; Backgrounds and
After Effects' preset categories (Shapes, Synthetics, Text, Image effects remain; Backgrounds, Behaviors and
Transitions exist) 15–35 h; the open effect bugs 10–20 h. Moving Fractal and the analysis effects to
the GPU is performance, not parity.
+1 -1
View File
@@ -63,7 +63,7 @@ are grouped by area; the issue tracker has the rest.
| 4 | **No CI gate on pull requests** | `.github/workflows` has release, packaging-lint, FreeBSD and Windows ARM64 jobs only; `cargo xtask ci` runs locally | Regressions reach main unseen; 49 community PRs landed in one batch (#598) | 4–8 h | G3 · this file |
| 5 | **Playback and scrubbing feel** | #595 stutter on cached frames (partly addressed: nearest-first RAM preview prefetch, cache bars at 1/3 resolution), #304, #504 / #335 audio late or crackling, #586 puppet lag (maintainers asked for details); #329 slow scrubbing (#784) and #554 closed | Preview is where motion designers spend their day | 25–50 h | G5 · [hardware-parity.md](hardware-parity.md) |
| 6 | **Linux and Windows interaction bugs** | Open: #488 rename arrows (hardening landed, reporter asked for details), #492 anchor drag, #268 file drops on Wayland (winit), #613 Direct3D 12 compositor. Now closed: #491, #493, #467, #320, #302, #596 | Many reports come from Linux; some Windows GPUs fail to start the compositor | 25–45 h | G2 · [ui-parity.md](ui-parity.md) |
| 7 | **Animation presets: 54 against 621** | After Effects ships 621 `.ffx` presets (Behaviors, Backgrounds, Shapes, Synthetics, Text, Transitions…); we ship 54 original presets (8 text-animator; 23 Transitions: wipes, clock and fan reveals, blinds, dissolves, card flips, CC wipes, fades, #757; 23 Backgrounds: drifting gradients, fog, cloud and smoke, plasma and magma, cells, hexagons, scrolling grids and checks, pulse rings, bokeh, light sweep, #1096, driven by expressions so they keep moving, not seamless loops) and read only our `.ecpreset`. Missing: Behaviors, Shapes, Synthetics, Image and more Text | Presets are how many designers start; tutorials assume them | 15–35 h (original presets; `.ffx` reading is out of clean-room scope) | G8 · [effects-parity.md](effects-parity.md) |
| 7 | **Animation presets: 76 against 621** | After Effects ships 621 `.ffx` presets (Behaviors, Backgrounds, Shapes, Synthetics, Text, Transitions…); we ship 76 original presets (8 text-animator; 23 Transitions: wipes, clock and fan reveals, blinds, dissolves, card flips, CC wipes, fades, #757; 23 Backgrounds: drifting gradients, fog, cloud and smoke, plasma and magma, cells, hexagons, scrolling grids and checks, pulse rings, bokeh, light sweep, #1096, driven by expressions so they keep moving, not seamless loops; 22 Behaviors: wiggle, shake, float, orbit, bounce, drift, pendulum, spin, pulse, heartbeat, blink, strobe, flicker on transform and opacity, #1510) and read only our `.ecpreset`. Missing: Shapes, Synthetics, Image and more Text | Presets are how many designers start; tutorials assume them | 15–35 h (original presets; `.ffx` reading is out of clean-room scope) | G8 · [effects-parity.md](effects-parity.md) |
| 8 | **Mask and shape bugs** | Open: #1004 mask vertex multi-select, #999 auto-pan, #1042 / #1033 vertex nodes under the bounding box, #932 Convert to Bezier Path, #959 / #960 shape group toggles and operators. Now closed: #510, #513, #527, #509, #303, #553 | Masks are core compositing | 10–20 h | G2 · [target-app-parity.md](target-app-parity.md) |
| 9 | **Effect behaviour bugs** | #580, #463 Curl Noise, #369 Motion Tile output size, #943 Turbulent Displace Evolution, #473 Cryptomatte selection (quoted names with commas fixed, 3b7f1ace; UI and GPU time open), #474 multi-layer EXR (decode shared, faffad3a; f16 storage and cache sizing open). Closed: #526, #514, #533–#536 | Each one breaks a look someone built | 10–20 h | G1/G2 · [effects-parity.md](effects-parity.md) |
| 10 | **Colour pipeline differences** | #340 ProRes 4444 tagged bt709 but sRGB-encoded (open); ACES 2.0 / OCIO 2.5 configs (26.5) missing; now closed: #494 32-bpc blend modes, #495 and #750 Working Gamma 2.4, #546 / #547 viewer colour | Wrong colour in delivery is a client-visible failure | 15–30 h | G1 · [file-format-parity.md](file-format-parity.md) |
+1 -1
View File
@@ -120,7 +120,7 @@ compositing and effects dominate; audio is light). Hours are to full parity for
| Expressions and scripting | 7% | 93% | 65% | 20–40 | `.jsxbin`, Startup/Shutdown folders, script shortcuts (`#include` landed, #759); external editor (#364); see [scripting-parity.md](scripting-parity.md) |
| Shapes, masks and roto | 9% | 93% | 45% | 30–50 | Open mask and shape issues (#1004, #999, #1042, #932); #510, #513, #527, #509 and #303 are closed; paste SVG/AI as shape layers (26.3; SVG markup pastes since #738) |
| Text and typography | 7% | 94% | 50% | 20–35 | CJK text in comps renders wrongly (#453); paragraph alignment inverted (#316); soft text at Fit (#417, mostly fixed by #444); toolbar font options (#550); #483 and #583 are closed; variable-font filter landed (#741) |
| Effects and animation presets | 14% | 85% | 40% | 70–130 | All 306 effects exist, but rendered output is unmeasured against After Effects; 54 built-in presets (text, Transitions, Backgrounds) against After Effects' 621 ([effects-parity.md](effects-parity.md)); open effect bugs (#580 crash, #463, #369, #473, #474; #514 and #526 are closed); effect colour labels (26.5); see [effects-parity.md](effects-parity.md) |
| Effects and animation presets | 14% | 85% | 40% | 70–130 | All 306 effects exist, but rendered output is unmeasured against After Effects; 76 built-in presets (text, Transitions, Backgrounds, Behaviors) against After Effects' 621 ([effects-parity.md](effects-parity.md)); open effect bugs (#580 crash, #463, #369, #473, #474; #514 and #526 are closed); effect colour labels (26.5); see [effects-parity.md](effects-parity.md) |
| 3D (Classic and Advanced) | 6% | 82% | 35% | 35–65 | No FBX/USD/STL models, no Substance materials, mesh displacement unverified; no 3D transform gizmos (#392, #347); reflections (#261); camera aperture (#260); #489 and #315 are closed |
| Tracking and AI-assisted tools | 5% | 80% | 35% | 35–70 | Object Matte (26.2) has the effect, the viewer tool (click / box), background tracking, Freeze and the 26.5 disk cache, not yet compared with After Effects; Roto Brush (MobileSAM) and face tracking (MediaPipe) unmeasured against After Effects; camera-tracker view (#505) |
| Preview and cache | 7% | 92% | 40% | 25–50 | Playback stutters on cached frames (#595, #304); late audio (#504, #335); #329 and #554 are closed; no benchmark against After Effects |