Skip to content

Add keyframe editing, easing curves, project save/load and last frame export#15

Open
halome wants to merge 1 commit into
time-to-move:mainfrom
halome:feature/keyframe-editing-easing-save-project
Open

Add keyframe editing, easing curves, project save/load and last frame export#15
halome wants to merge 1 commit into
time-to-move:mainfrom
halome:feature/keyframe-editing-easing-save-project

Conversation

@halome

@halome halome commented Apr 25, 2026

Copy link
Copy Markdown

Summary

  • Keyframe editing: Click markers to select and edit existing keyframes (position, rotation, scale) in real-time
  • Easing per segment: Linear, ease_in, ease_out, ease_in_out curves with per-keyframe dropdown
  • Project save/load: Full .ttmproj format preserving layers, keyframes, external sprites, transforms
  • Export last frame: Saves both first_frame.png and last_frame.png
  • Live sync: Item drag always updates active keyframe without needing "End Segment" click

Changes

  • Renamed "End Segment" → "Add Keyframe" for clarity
  • Added KeyframeMarker class with click-to-select behavior
  • Added apply_easing() function applied in both demo and export interpolation
  • Added on_save_project() / on_open_project() with JSON serialization
  • Removed "pending segment" blocking — keyframes always stay in sync with item position
  • Export validates minimum 2 keyframes instead of pending transform check

Test plan

  • Create segments, click markers to edit positions — path lines update in real-time
  • Change easing dropdown while marker selected — verify in Play Demo
  • Save project, close app, reopen, load project — verify identical state
  • Export with last_frame.png generated alongside first_frame.png
  • Undo removes last keyframe correctly

… export

## Keyframe Editing
- Add clickable KeyframeMarker circles on canvas at each keyframe position
- Click marker to select keyframe — item snaps to that position
- Drag item to edit selected keyframe (position, rotation, scale) in real-time
- Path lines and markers update live during edits
- Rename "End Segment" to "Add Keyframe" for clarity

## Easing Per Segment
- Add easing support: linear, ease_in, ease_out, ease_in_out
- Easing dropdown in toolbar, stored per keyframe
- Applied in both demo playback and export interpolation
- Click marker to select keyframe, change easing in dropdown — updates immediately

## Live Sync
- Item drag always updates the active keyframe (selected or last)
- NotifyingPixmapItem callback syncs position/rotation/scale to keyframe
- Guard flag prevents recursive sync loops
- Remove "pending segment" blocking — segments are always in sync

## Project Save/Load
- Save Project (.ttmproj) — JSON with base image path, layers, keyframes,
  easing, external sprites, transform state, colors
- Open Project — restores full editor state including external sprites,
  handles, NotifyingPixmapItem callbacks, markers and path lines
- External sprites saved as processed PNGs (no re-scaling on load)
- Transform origin, position, rotation, scale all preserved

## Export Last Frame
- Export now saves both first_frame.png and last_frame.png
- Minimum 2 keyframes validation for export

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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