Conversation
There was a problem hiding this comment.
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
UndoHelpereven whenSkipXMLoptimizations 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.
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>
There was a problem hiding this comment.
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
UndoHelperwith 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.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
See https://forum.shotcut.org/t/keyframes-dont-get-restored-after-undo/48044