Skip to content

Timeline, keyframes, Graph Editor, Puppet and pick whip fixes from #284 - #381

Merged
bflatastic merged 10 commits into
mainfrom
fix/284-timeline-keys-tools
Oct 9, 2026
Merged

bflatastic merged 10 commits into
mainfrom
fix/284-timeline-keys-tools

Conversation

@bflatastic

Copy link
Copy Markdown
Member

This covers the Timeline / Playback, Properties / Keyframes, Graph Editor, Tools and Expressions items of #284 (Windows 11). The UI / General items are handled separately. Each item was checked against current main, not the reporter's build. There is one commit per item, and each fix has a test that fails without it.

Item Status / Fix
1. A click in the ruler doesn't move the CTI until you drag Fixed. The current time now jumps to the pointer as soon as the button goes down in the time ruler, then follows the drag (After Effects).
2. Scrubbing renders every frame Fixed. Each newer viewer request only demoted older ones to prefetch, so every frame the pointer passed was still rendered, oldest first. A newer viewer frame now drops that comp's viewer frames that haven't started and releases them. A frame that is already rendering finishes into the cache, because the renderer can't be interrupted mid-frame. The viewer keeps showing its last frame until the new one arrives. Prefetch frames and other comps' viewer frames stay queued.
3. Shift-click on layer bars doesn't select a range Fixed. Shift-clicking a bar now selects the same range as Shift-clicking a name, using the shared shift_range. A click on a bar also sets where the next range starts.
4. Ctrl/Cmd+Alt drag to offset selected keys/layers in selection order Skipped: not After Effects core. In AE, Alt-dragging keyframes scales them in time, which EffectCraft already does. Layers are offset in selection order with Keyframe Assistant ▸ Sequence Layers, which already exists here (layer.sequence). A drag that staggers keyframes in selection order comes from scripts (stagger/offset tools), not from AE itself.
5. No cache indication in the Timeline Already worked. Main draws a green line under the work area bar for frames cached at the viewer's resolution, view and options, and blue for frames cached on disk. I found no state where it's missing. A test now covers it.
6. Click-drag over stopwatches Fixed. Pressing a stopwatch toggles it. Dragging on gives every stopwatch the pointer passes the state the first one got, in one undo step, whatever its own state. This reuses the switch-drag gesture from #238, now switch_gesture, shared with the layer switches. prop.toggleAnimation takes merge. Alt+click still adds an expression.
7. Heavy black keyframe borders Fixed. Keys are drawn flat, without a dark outline, as in AE. Each half is edged in its own colour so there is no seam, and overlapping keys read as one shape. The Light theme's keyframe grey is darker so unselected keys still stand out.
8. Graph Editor: adjust the handles of all selected keys Fixed. Dragging a handle moves the same side's handle of every selected key by as much as the pointer moved, in time and in value or speed, in one undo step. Handles move relative to where the drag began, so one that stops at a limit doesn't keep pushing the others.
9. The eyedropper samples only the layer Partly already worked; one bug fixed. On main, effect eyedroppers already sample the composite shown in the viewer; crosshair_and_eyedropper_pick_from_the_viewer covers this. Keyers deliberately sample their input, so a screen that's already keyed out can still be picked. The bug: the eyedropper and the Info panel read the shown frame as if it covered the whole comp. With a Region of Interest, or the Extended Viewer in a 3D view, the frame covers only that area, so they sampled the wrong place, often the layer. They now map the point through the area the frame actually covers.
10. Puppet tool: you can switch layers while using it Fixed. While selected layers have a Puppet effect, the Puppet tools act only on them, as in AE. A click elsewhere neither selects nor rigs another layer. Previously a click off the pins called the selection pick, which selected and rigged whatever layer was under the pointer. With no rigged layer selected, the tools pick the layer under the pointer as before.
11. Pins can only be placed inside the original layer bounds Fixed (same commit as 10). A click is hit-tested against each rigged layer's mesh as it is deformed now, so a pin lands on the deformed shape even past the layer's own bounds. puppet::contains does this test. puppet.addPin now uses it too; its own inside test only worked for one triangle winding.
12. Pick whip doesn't work while editing an expression Fixed. A pick whip pressed while the expression is being edited puts the reference at the cursor, replacing any selected text (AE). Editing then continues with the cursor after the reference. Before, the reference replaced the whole expression, and the editor still had the focus, so it wrote its old text back over it. Without an edit in progress, the reference still replaces the expression. prop.pickWhip takes expression and range (in characters).

Tests

  • ui_timeline_zoom::a_press_in_the_ruler_moves_the_current_time (1)
  • frames::tests::a_newer_viewer_frame_drops_the_ones_still_waiting (2)
  • ui_workflow_selection::timeline_shift_click_on_layer_bars_selects_the_range (3)
  • ui_ram_preview::the_timeline_shows_the_cached_frames_in_green (5, a regression guard; main already passes it)
  • ui_timeline_switches::dragging_over_stopwatches_sets_them_all, engine stopwatch_toggles_with_a_merge_key_are_one_undo_step (6)
  • icons::tests::keyframes_are_drawn_without_a_dark_outline (7)
  • ui_keyframes::a_graph_handle_drag_moves_the_handles_of_every_selected_key (8)
  • ui_effect_controls::the_eyedropper_samples_under_the_pointer_in_a_region_of_interest, plus the updated fx_widgets eyedropper_samples_straight_colour (9)
  • ui_viewer::puppet_pins_go_on_the_deformed_mesh_and_the_tool_stays_on_the_rigged_layer (10, 11)
  • ui_inline_edit::the_expression_pick_whip_inserts_at_the_cursor_while_editing, engine pick_whip_inserts_into_the_expression_being_edited (12)

I reverted each fix commit on its own, with its test kept, and confirmed the UI or frames test fails: items 1, 2, 3, 6, 8, 9, 10/11 and 12. Item 7's unit test checks the painted shapes, and the old glyphs had a black stroke. The engine tests fail by construction, because before this PR the merge and expression/range parameters were ignored.

Not checked:

  • The changes were not checked by hand in the running app on Windows. All checks are headless egui_kittest and unit tests.
  • I didn't measure how scrubbing feels with heavy comps. Renders already in progress still finish.
  • AE's exact rule for moving several selected handles (equal pointer offset in graph space) and its Puppet-tool layer locking come from its documentation and observed behaviour, not from a side-by-side capture.

Gate: cargo fmt --all --check, cargo clippy -j 4 -p effectcraft-effects -p effectcraft-engine -p effectcraft-ui-egui --all-targets -- -D warnings. Tests passed: the ui-egui lib (106), ui_timeline_zoom, ui_timeline_switches, ui_workflow_selection, ui_inline_edit, ui_keyframes, ui_effect_controls, ui_viewer, ui_ram_preview, and the engine tests_timeline, puppet, pick-whip and effects puppet tests. I did not run the full cargo xtask ci (layers/assets/wasm) on this machine.

🤖 Generated with Claude Code

bflatastic and others added 10 commits October 9, 2026 16:59
The ruler moved the current-time indicator only once the pointer had
dragged past egui's drag threshold, or on release for a click. As in
After Effects, the time now jumps to the pointer as soon as the button
goes down in the ruler, then follows the drag.

Test: a_press_in_the_ruler_moves_the_current_time (ui_timeline_zoom).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Scrubbing asks for the viewer frame under the pointer at every step.
Each newer request only demoted the earlier ones to prefetch, so every
frame the pointer passed was still rendered, oldest first, holding the
frame threads the frame under the pointer needed. A newer viewer frame
of a comp now drops that comp's viewer frames that haven't started
(and releases them, so they can be asked for again). Frames already
rendering finish into the cache (rendering can't be interrupted
mid-frame), and the viewer keeps its last frame until the new one is
in. Prefetch frames and other comps' viewer frames stay queued.

Test: a_newer_viewer_frame_drops_the_ones_still_waiting (frames).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Shift-clicking a layer's name selected the layers from the last one
clicked to it, but Shift-clicking a layer bar in the time graph only
added that layer. Bars now select the same range (shared with the
name column: `shift_range`), and a click on a bar becomes where the next
range starts, as a click on a name does.

Test: timeline_shift_click_on_layer_bars_selects_the_range
(ui_workflow_selection).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
#284 reported no cache indication in the Timeline. Main has one: a
green line under the work area bar for the frames cached at the
viewer's resolution, view and options (blue for disk-cached frames).
This test pins it down: once the viewer's frame has rendered, the
Timeline paints the green line from the start of the work area.

Test: the_timeline_shows_the_cached_frames_in_green (ui_ram_preview).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
As in After Effects, pressing a property's stopwatch toggles it, and
dragging on over the stopwatches above or below gives every property
the pointer passes the state the first one got (animated or not),
whatever its own, in one undo step. Alt+click still adds an
expression.

The gesture is the layer switches' press-and-drag from #238, moved
into `switch_gesture` and shared by both. `prop.toggleAnimation` takes
`merge` so the drag folds into one undo step.

Tests: dragging_over_stopwatches_sets_them_all (ui_timeline_switches),
stopwatch_toggles_with_a_merge_key_are_one_undo_step (engine).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Each half of a keyframe glyph had a 1 px near-black border, so keys
that overlap read as a tangle of borders. Keys are now flat, as in
After Effects: each half is filled and edged in the key's own colour
(the hairline closes the seam between the halves), so overlapping keys
read as one shape. The Light theme's keyframe grey is darker so
unselected keys still stand out on its light time graph without the
border.

Test: keyframes_are_drawn_without_a_dark_outline (icons).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…284)

Dragging a Bezier handle in the Graph Editor changed only that key's
ease. As in After Effects, the same side's handles of every selected
key now move with it, by as much as the pointer moved (time and value
or speed alike), in one undo step. Each handle keeps its offset from
where the drag began, so a handle stopped at a limit (100 % influence)
doesn't drag the others on.

Test: a_graph_handle_drag_moves_the_handles_of_every_selected_key
(ui_keyframes).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…est (#284)

Effect eyedroppers (other than keyers', which pick from the effect's
input) sample the composite the viewer shows; a test covers that on
main. But they, and the Info panel, read the shown frame as if it
covered the whole comp. With a Region of Interest, or the Extended
Viewer of a 3D view, the frame covers only that area, so they read a
pixel somewhere else. They now map the point through the area the
frame covers (`shown_region`, `frame_pixel`).

Tests: the_eyedropper_samples_under_the_pointer_in_a_region_of_interest
(ui_effect_controls), eyedropper_samples_straight_colour (fx_widgets).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…d mesh (#284)

With a Puppet tool, a click off the pins picked the topmost layer under
the pointer by its own bounds, and selected it. So a click where the
deformation had stretched the mesh past the layer's bounds went to the
layer behind (selecting it and giving it a Puppet effect), and any
click on another layer switched to it.

While selected layers have a Puppet effect, a click (or a press that
might start a pin marquee) now works only on them, as in After
Effects: on the layer whose mesh, as deformed now, is under the
pointer (the pin lands on the deformed shape), else the one whose own
art is (a new mesh); elsewhere nothing happens and the selection
stays. Without a rigged layer selected, the tools pick and rig the
layer under the pointer as before.

`puppet::contains` tests a point against a deformed mesh; `puppet.addPin`
uses it too (its own test only held for one triangle winding).

Test: puppet_pins_go_on_the_deformed_mesh_and_the_tool_stays_on_the_rigged_layer
(ui_viewer).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Dragging an expression's pick whip always replaced the whole
expression, also while it was being edited (and the editor then wrote
its old text back over the reference). As in After Effects, a pick
whip pressed while the expression is being edited now puts the
reference at the cursor, replacing the selected text, and the editing
goes on with the cursor after the reference. Without an edit in
progress it replaces the expression as before.

`prop.pickWhip` takes the text being edited (`expression`) and the
selection in it (`range`, in characters) to insert there.

Tests: the_expression_pick_whip_inserts_at_the_cursor_while_editing
(ui_inline_edit), pick_whip_inserts_into_the_expression_being_edited
(engine).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@bflatastic
bflatastic force-pushed the fix/284-timeline-keys-tools branch from 5d568b2 to bf09a4f Compare October 9, 2026 10:11
@bflatastic
bflatastic merged commit 735482d into main Oct 9, 2026
@bflatastic
bflatastic deleted the fix/284-timeline-keys-tools branch October 9, 2026 10:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant