Skip to content

Fix keyframes after undo trim in#1795

Merged
bmatherly merged 6 commits intomasterfrom
fix-forum-bug-48044
Mar 14, 2026
Merged

Fix keyframes after undo trim in#1795
bmatherly merged 6 commits intomasterfrom
fix-forum-bug-48044

Conversation

@ddennedy
Copy link
Copy Markdown
Member

@ddennedy ddennedy commented Mar 13, 2026

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes loss of clip keyframes after undoing a “trim in” by selectively capturing clip XML during the trim and restoring the full clip from XML during undo when needed.

Changes:

  • Add selective per-clip XML capture to UndoHelper even when SkipXML optimizations are enabled.
  • Update trim-in flows to mark the trimmed clip for XML capture so deleted keyframes can be restored on undo.
  • Enhance UndoHelper::undoChanges() to fully restore a clip from stored XML for in/out-only modifications.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
src/docks/timelinedock.cpp Marks the active clip for XML capture during non-ripple trim-in to support restoring deleted keyframes on undo.
src/commands/undohelper.h Adds API/state for selective per-clip XML capture (storeXmlForClip, m_xmlClips).
src/commands/undohelper.cpp Stores XML for selected clips under SkipXML and restores clips from XML during undo when available.
src/commands/timelinecommands.cpp Aligns trim-in command undo-helper hints and marks trimmed clip for XML capture in the non-ripple case.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

ddennedy and others added 3 commits March 13, 2026 14:05
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes an undo regression where trimming a clip’s in-point could delete keyframes that were not restored after undo, by selectively capturing clip XML and restoring from it during undo.

Changes:

  • Store producer XML for the specific clip being trimmed-in (when using SkipXML) so undo can fully restore deleted keyframes.
  • Extend UndoHelper with per-clip XML opt-in (storeXmlForClip) and use it when recording before-state.
  • During undo of in/out changes, optionally restore a clip by removing/reinserting from stored XML (instead of only resizing).

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
src/docks/timelinedock.cpp For non-ripple trim-in, opt-in to storing XML for the trimmed clip so undo can restore keyframes.
src/commands/undohelper.h Adds API/state (storeXmlForClip, m_xmlClips) to selectively store XML even under SkipXML.
src/commands/undohelper.cpp Stores XML for opt-in clips under SkipXML and restores clips from XML on undo of trim changes.
src/commands/timelinecommands.cpp For non-ripple trim-in commands, opt-in to storing XML for the trimmed clip (matching interactive trim behavior).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

ddennedy and others added 2 commits March 13, 2026 14:37
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Member

@bmatherly bmatherly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great. Thanks!

@bmatherly bmatherly merged commit ccfdb8b into master Mar 14, 2026
2 checks passed
@bmatherly bmatherly deleted the fix-forum-bug-48044 branch March 14, 2026 14:30
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.

3 participants