Split works on every selected frame

Split (menu and shortcut) splits each selected frame that spans the time
under the cursor or playhead; triggers are skipped.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
shweetandClaude Opus 5.5 committed 2026-10-06 00:51:48 -04:00
1 parent f4fd255a02
commit 94d0bbf206
5 files changed
+33 -4

No files matched your search

+1
View File
@@ -97,6 +97,7 @@ namespace anm2ed::edit
Uids frames_reverse(model::Model&, const std::set<Reference>&);
Uids frames_bake(model::Model&, const std::set<Reference>&, int, bool, bool);
Uids frame_split(model::Model&, Reference, int);
Uids frames_split(model::Model&, const std::set<Reference>&, int);
Uids frames_move(model::Model&, const std::set<Reference>&, Reference, int);
Uids frame_durations_set(model::Model&, const std::map<Reference, int>&);
Uids trigger_at_frame_set(model::Model&, Reference, int);
+9
View File
@@ -165,6 +165,15 @@ namespace anm2ed::edit
return {uid};
}
// Splits each of the frames that spans the time (last first, so earlier references stay valid).
Uids frames_split(Model& model, const std::set<Reference>& references, int time)
{
Uids uids{};
for (auto it = references.rbegin(); it != references.rend(); ++it)
std::ranges::copy(frame_split(model, *it, time), std::back_inserter(uids));
return uids;
}
// Moves frames (from any tracks) into one track before the frame at the given index.
Uids frames_move(Model& model, const std::set<Reference>& frames, Reference target, int insertIndex)
{