Remove items in use; drop Remove Unused

Every content window's Remove (the Delete key) takes the selection out with
what refers to it: a layer's or null's tracks in every animation, a
spritesheet's plain layers (and regions), an event or sound from its triggers
(dropping triggers left with neither), a shader or region from its frames
(which keep the region's rectangle), and a library's layers, flattened into
plain ones. When anything is in use it asks first, listing what goes ("This
will remove:" ... "Are you sure?"). Remove Unused is gone; Remove takes its
place in each footer.

One reference walk (model.cpp) counts uses and finds unused items, so
shaders on null and root frames count, and an animation layer's unused
spritesheet doesn't. Flattening can be limited to some layers, merging only
their children's triggers, which now record the layer they fired through.
edit::content_remove does the removal; Document::spritesheet_path_resolver_get
is shared with saving.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
shweetandClaude Opus 5.5 committed 2026-10-28 22:33:25 -04:00
1 parent c9d68781d0
commit 065dd522f3
22 files changed
+475 -224

No files matched your search

+1 -1
View File
@@ -379,7 +379,7 @@ namespace anm2ed::model
const Spritesheet* layer_spritesheet_get(int) const;
Frame frame_effective(int, const Frame&) const;
std::set<int> unused_get(ElementType, const Animation* = nullptr) const;
std::set<int> region_unused_get(int) const;
int uses_count(ElementType, const std::set<int>&, int = -1, const Animation* = nullptr) const;
std::uint64_t uid_get(Reference, bool = false) const;
Handle handle_get(Reference, bool = false) const;
void uids_repair();