Commit Graph
93 Commits
Author SHA1 Message Date
shweetandClaude Opus 5.5 d1a6d89d14 Libraries window, animation layers and child playback
A Libraries window (docked with Spritesheets and Sounds) links other .anm2
files: cards list each one's animations, open it as a tab, and reload when
it changes on disk. A layer's Source is a spritesheet or an animation, from
this file or a library; the preview, renders and CLI draw the child in the
layer's frame. Animation-layer keyframes set the child's animation, mode
(loop, once, hold), start frame (or random) and restart; Child is also a
copyable frame property. All of it is editor-only and counted by the Isaac
warning.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 16:51:48 -04:00
shweetandClaude Opus 5.5 1381824fb7 Rename Shear to Skew
The property, tool, settings, strings and saved attribute are now Skew
(SkewX/SkewY in the editor's copy). Files with ShearX/ShearY still load,
and settings saved under the old names carry over. Goldens differ only in
the attribute name.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 15:42:36 -04:00
shweetandClaude Opus 5.5 2ce8795b4a Trigger sounds: overlap instead of cutting off, and play once per frame
- A sound can play over itself: each play uses a track that isn't busy
  (reusing finished ones), so close triggers no longer restart each other.
  Rendered audio mixes them the same way.
- The preview plays each frame's trigger sound once as playback reaches the
  frame, instead of on every tick spent in it, and no longer skips the
  sound of a frame passed over between ticks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-06 22:26:00 -04:00
shweetandClaude Opus 5.5 251d04848a Timeline start/end markers
Right-clicking the numbered row offers Add Start/End Marker Here and
Remove Markers; Shift+Comma / Shift+Period (configurable) set them at the
playhead. Markers are faded playheads, with the numbers outside their
range darkened, and playback loops within them. They are saved as
StartMarker/EndMarker on the editor's copy (SourceDocument) only, as one
undoable edit each.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 21:03:00 -04:00
shweetandClaude Opus 5.5 24af98a68e Onionskin: Pivot Path and Only Selected Item
Pivot Path draws, on the preview, the path each item's pivot travels:
a red point per frame joined by a red dashed line (Canvas::line_render,
on the dashed shader). Only Selected Item limits the onionskin samples
and pivot paths to the selected root, group root, layer or null. Paths
are cached until the document, animation or root-transform view changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 20:58:39 -04:00
shweetandClaude Opus 5.5 70abe366a0 Scales are saved as percents, clamped on load
UI Scale (50-200%) and render Scale (25-1000%) both step by 25%. Settings
saved as multipliers read as tiny percents and clamp to the minimum.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 20:07:53 -04:00
shweetandClaude Opus 5.5 4b6e186f57 Canvases handle input before rendering
Hover is tested against the canvas rectangle (is_canvas_hovered) before the
image is drawn, so pan, zoom, the region hover highlight and the checker
background follow the mouse in the same frame instead of one frame late.
The spritesheet editor's second hover/mouse computation is gone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 19:03:12 -04:00
shweetandClaude Opus 5.5 4c569cb1e5 Stage 10a: delete dead code, merge tiny files, unify duplicated concepts
- Dead code: util/map, util/unordered_map, unused vector/math/string/input
  helpers, Document getters, special-interpolation bake leftovers,
  triggers_sort, SnapshotStack::max_size_get, AudioStream capture API.
- Merges: util/xml, util/string, resource/strings.cpp inlined; constants
  into input.hpp; tooltip into layout; Recorder into render; onionskin,
  tools, welcome and frame properties are panel functions; timeline
  popups.cpp folded into timeline.cpp.
- util/origin.hpp replaced by model Origin (the merge setting stays a
  combo index, so saved preferences keep their meaning).
- Item type names/icons/colors moved from model/common.hpp to the
  timeline header; the model no longer includes icon/strings headers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 18:35:22 -04:00
shweetandClaude Opus 5.5 4d16f21541 Stage 9c: Recorder for renders; no settings override; spritesheet follows selection
- Recorder (imgui/window/recorder.*) owns a render: frame times, captured
  frames on disk, per-frame trigger sounds, and assembling PNGs, spritesheets
  (Image::paste) or ffmpeg output. Start, finish, cancel and failure share one
  stop path.
- Isolated and bounded renders no longer overwrite and restore Settings, pan,
  zoom and overlay: the preview draws with view values derived for the render.
- Image::region_get replaces the region export's own pixel copy.
- Selecting layer frames focuses their spritesheet (Document::frame_references_set)
  instead of the spritesheet editor forcing it every frame.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 18:15:06 -04:00
shweetandClaude Opus 5.5 39ccfb723a Stage 9b: animations draw from a model draw list
- model::animation_draws_get returns what an animation draws at a time (root,
  group roots, layers, nulls; onion-skin samples first), with root and group
  root transforms as each item's parent and their tint/offset folded into
  layer frames.
- The preview, the About friends and animation_rect all use it; the
  preview's render lambda shrinks to drawing the list.
- Tests for draw order and root folding.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 18:11:19 -04:00
shweetandClaude Opus 5.5 595658581f Stage 9a: shared canvas input, edit helpers and tool requirements
- CanvasInput gathers mouse, arrow keys (as a step vector), zoom and modifier
  state once; arrow nudges are one change per tool instead of four.
- frames_change_push/edit_begin_push/document_change_push replace each
  editor's own grouped frame-change command; rect_snap replaces three copies
  of grid-snap code.
- tool::INFO carries whether a tool needs a frame or a spritesheet;
  tool_cursor_update sets the cursor and the "why not" hint for both canvases.
- localize_format for localized format strings.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 18:08:57 -04:00
shweetandClaude Opus 5.5 0b6f67d9bd Stage 7: typed model; Element tree is internal to model/xml.cpp
- src/model: typed Model (Info, Content, nested TrackGroup/AnimationGroup,
  copy-on-write shared animations, Extras/XmlNode passthrough for unknown XML,
  layout vectors so saves stay byte-identical).
- src/edit, Document, Selection, Snapshots, every window, the timeline, wizards
  and popups now read and edit model::Model; no UI code touches Element.
- anm2/ is reduced to the XML reader/writer/normalizer behind model/xml.cpp;
  dead Element operations (merge, regions, item_add, rect, frame helpers,
  element_get/unused, deserialize) are deleted.
- Goldens, invariants, undo walk and the local corpus (1,251 files) match.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 16:53:17 -04:00
shweetandClaude Opus 5.5 2d0f70b1e5 Stage 6: Document::change() always refreshes derived data; ChangeType removed
change() now flushes drafts, re-syncs assets and shaders, rebuilds every label
list and the uid index, and commits. Document::ChangeType, the switch in
change(), the type parameter of edit_apply/edit_run/edit_push/assets_sync,
Window::changeType and every per-call change type (about 40 sites) are gone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 15:59:44 -04:00
shweetandClaude Opus 5.5 9f43a210c5 Stage 5: content-hash AssetStore; undo records asset keys, not pixels
- resource::AssetStore (core) keeps immutable images and sounds keyed by content
  hash for the life of the document; nothing is purged until it closes.
- Undo state holds spritesheet/sound id -> asset key maps (always tracked), so
  every edit can undo texture changes; the textures-only snapshot flag
  (edit_begin(label, true) / push(message, isTextures)) and the pixel/audio
  equality helpers are gone.
- Document::texture_get/sound_get read through the store; texture_set/sound_set
  add assets; texture_edit gives the pencil a private draft that becomes a new
  asset on the next change().
- Spritesheet dirty state compares path + asset key instead of hashing pixels.
- Preview audio reads sounds through the store.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 15:53:34 -04:00
shweetandClaude Opus 5.5 65a3546c3b Stage 4: one uid-based Selection for the timeline and animations list
- Selection { map<kind, set<uid>> uids; Handle focus; } (src/selection.*, core)
  replaces Document::reference, the frames/items/animation Storages,
  groupReferences, and the timeline's selection snapshot/lock/focus state.
- Because selection is by uid it follows elements through edits by itself;
  after an edit or undo, selection_follow only drops removed uids and moves a
  removed focus to its nearest survivor. The Stage 2 handle capture/re-resolve,
  frames_reference_normalize_for, frames_selection_sync_for and the index-based
  frame validity repair are gone.
- Document keeps a UidIndex (rebuilt on every change) and exposes
  reference_get/reference_set, selected_get/selected_set(kind),
  frame_references_get/set and animations_selected_get/set.
- UidIndex records each uid's element type.
- The animations list keeps its ImGui multi-select Storage as a per-frame mirror
  of the Selection; content windows are unchanged until Stage 8.
- tests/selection.cpp and tests/undo.cpp cover selection through inserts,
  reverses, deletes, item and animation removal, regrouping and undo.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 15:46:47 -04:00
shweetandClaude Opus 5.5 700b613c62 Stage 3: operations layer (src/edit) and one undo entry point
- src/edit/ (in anm2ed_core): frame, track, animation, region, grid and
  change-all edits as plain functions of the model. Each returns the uids of what
  it created for the UI to select; copies get fresh uids.
- Document::edit_apply snapshots, runs an operation and commits; edit_begin
  starts drag edits. window_edit, edit_command_push, snapshot_command_push,
  SnapshotKind and the tracks/frames/regions/textures snapshot kinds are gone;
  Snapshots has a single push(message, isTextures).
- Timeline, animations, regions, shaders, items, wizards, taskbar and file merge
  call the edit layer; they keep only selection, scrolling and toasts.
- Snapshots, Storage, Playback and ImGui core build into anm2ed_core, so undo is
  testable: tests/undo.cpp runs a seeded random walk of edits per fixture and
  checks every undo/redo state by hash, plus selection follow through undo.
- types::edit renamed types::edit_state (clashed with the edit namespace).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 15:26:53 -04:00
shweetandClaude Opus 5.5 26ab394fe4 Stage 1: headless Image and AudioData; GPU and playback caches in the UI
- resource::Image (pixels, size, uid) replaces Texture in documents, undo and
  wizards; it lives in anm2ed_core with no GL. uid changes with the pixels.
- resource::texture::id_get uploads lazily and evicts textures not drawn in a frame
- resource::AudioData (bytes, uid) replaces Audio; resource::audio::play/stop/
  track_detach/is_playing cache decoded audio and tracks per uid
- Resources::icon_id_get shortens the icon call sites
- tests/assets.cpp covers Image png round trip, uid tracking, merge_append

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 14:52:34 -04:00
shweetandClaude Opus 5.5 ec72a30ce0 Canvas windows, settings and manager: share view code and list I/O
- CanvasView base holds checker pan sync, zoom step, grid panel, view buttons and view context menu
- frame_parent_model_get replaces five root/group transform compositions
- Canvas builds VAOs through one helper, unifies uniform setters and frees the texture VAO/VBO/EBO (leak fix)
- Settings load/save loop over component suffix tables; unused settings Type enum removed
- Manager shares one path-list load/save for recent and autosave files
- Anonymous namespaces removed per project style

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 13:50:13 -04:00
shweetandClaude Opus 5.5 3f31cedeed Slim Document: move data-model code out, unify edit plumbing
- Region generate/scan move to anm2/regions.cpp; both generators number from 1
- file_merge moves to anm2/merge.cpp and is table-driven
- MaxRects packer moves to util/pack
- Uniform config apply/trim/save move to resource/shader
- Snapshots push from their owned state; Document snapshot wrappers removed
- DocumentData base replaces the hand-written move constructor
- toast_log replaces 55 duplicated toast + English log pairs
- Apply repo .clang-format to touched files

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 13:08:00 -04:00
shweetandClaude Opus 5.5 a9f48bc3a0 De-bloat anm2 core: templates, tables, unified emitter
- Collapse const/non-const pairs into templates; Anm2::element_get uses deducing this
- Drive container/track/item mappings from ANM2_ELEMENT_TYPES, ANM2_ITEM_TYPES and TRACK_CONTAINERS
- One sink-based emitter feeds both XML writing and hashing
- frame_mix and frame_bake_split replace five copies of the bake/lerp loop
- item_add replaces layer_animation_add/null_animation_add
- Fix timeline split ignoring shear

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 12:54:24 -04:00
shweet b7c24fad99 shading and shearing 2026-08-20 20:03:12 -04:00
shweet a4b34cc0be remove overlay window, add document overlay + over/under 2026-08-07 14:42:16 -04:00
shweet ff76932555 fix merge window, fix hash slowness (again), touch up overlays (still not sure about them) 2026-07-19 22:35:48 -04:00
shweet c28ea8eb6f tick/fps difference in render animation; touched up 2026-07-10 21:21:25 -04:00
shweet 5792dd25a2 Overlays, Shaders, Group Roots, Serialization Changes. Legalize Nuclear Bombs 2026-07-09 19:49:33 -04:00
shweet 80ef3f8597 buncha slop 2026-07-01 20:04:12 -04:00
shweet 6d206045c7 spritesheet editor fix, zoom levels 2026-06-20 22:27:11 -04:00
shweet dbc1c132bd zoomin' 2026-06-20 15:12:52 -04:00
shweet 4db3e28ced some new crap 2026-06-20 15:06:04 -04:00
shweet 93707b234c fix tools 2026-05-22 11:50:03 -04:00
shweet 6e5d73c639 header cleanup 2026-05-22 10:20:43 -04:00
shweet b1c9d38ef5 Friends :) 2026-05-22 08:15:16 -04:00
shweet 1bc5199e3b Holy vibecode Batman! 2026-05-21 21:00:57 -04:00
shweet b7b49eb81e some bullshit to fix potential crash 2026-05-14 22:58:32 -04:00
shweet 8f72f0aef5 autosave fix + item properties change 2026-05-11 23:33:39 -04:00
shweet d08f3d2231 touched up animation preview/timeline 2026-05-11 15:57:07 -04:00
shweet 5c746d99c2 60Hz 2026-05-07 00:19:53 -04:00
shweet a1bdbeba1c transparency for animation preview, QoL, change raw animation 2026-05-03 11:22:42 -04:00
shweet e9cd4f1ec4 fix potential crash with animation preview transform 2026-04-27 18:55:33 -04:00
shweet 8fbccb2257 Merge branch 'staging' 2026-04-08 20:01:35 -04:00
shweet 378a7692e2 add #include format 2026-04-08 20:00:13 -04:00
shweet 0b91382f0f changes + more windows bs 2026-03-29 20:13:24 -04:00
shweet b1213d7d23 Merge branch 'staging'
# Conflicts:
#	.vscode/launch.json
#	.vscode/tasks.json
#	src/imgui/window/animation_preview.cpp
#	src/imgui/window/regions.cpp
2026-03-19 03:51:13 -04:00
shweet ad125c15a2 queue oh el 2026-03-19 03:46:42 -04:00
shweet 4f5966dad6 fix path issues 2026-03-17 00:47:36 -04:00
shweet a83dbd5b6c Render animation fixes, vs code tasks 2026-03-15 13:53:46 -04:00
shweet f58d89425f Render animation fixes, vs code tasks 2026-03-15 13:52:42 -04:00
shweet bbfafd7331 Render animation fixes, vs code tasks 2026-03-15 13:22:53 -04:00
shweet 1b5ba6b584 fix audio desync for realsies, stderr to log.txt 2026-03-10 00:36:21 -04:00
shweet c11b404392 let's actually stage those changes... 2026-03-09 23:09:37 -04:00