Repository navigation
Fix source ranges in the edit algorithms - #2079
darbyjohnston merged 3 commits into
Conversation
Codecov Report❌ Patch coverage is
❌ Your changes status has failed because you have indirect coverage changes. Learn more about Unexpected Coverage Changes and reasons for indirect coverage changes. Additional details and impacted files@@ Coverage Diff @@
## main #2079 +/- ##
==========================================
- Coverage 87.33% 87.33% -0.01%
==========================================
Files 189 189
Lines 13925 13930 +5
Branches 1273 1273
==========================================
+ Hits 12162 12166 +4
- Misses 1592 1593 +1
Partials 171 171
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
camkerr
left a comment
There was a problem hiding this comment.
This looks good, thank you @darbyjohnston.
I tested all of these edit functions, wrote out their otio files and then brought each one into Resolve for a visual check. Everything is behaving as expected. I tried to follow the examples you showed in the SVGs. I've attached my test files here.
The bugs show with clips whose source ranges do not start at zero, which the tests did not use: - overwrite: a partly overwritten last item kept the wrong part, and an item longer than the range was given the overwritten item's start - insert: the second half of the split item skipped the inserted item's duration in the source - roll: moving the end did not change the next item's duration, so the end of the next item moved; the clamp for the start was wrong - ripple: the clamp for the start compared the delta to the start time - trim: trimming the start extended a previous clip instead of filling the hole, and trimming the end did not shrink or grow a following gap test_edit_insert_8, test_edit_roll_3, test_edit_roll_4 and test_edit_fill_2 expected the old results. Signed-off-by: Darby Johnston <darbyjohnston@yahoo.com>
Signed-off-by: Darby Johnston <darbyjohnston@yahoo.com>
d24b281 to
c8f9eff
Compare
timlehr
left a comment
There was a problem hiding this comment.
Thanks @camkerr for testing the changes. I had a look at the code and it looks fine. Go ahead @darbyjohnston.
|
Great, thanks for the reviews, I'll go ahead and merge... |
363d71e
into
AcademySoftwareFoundation:main
This PR has various fixes for the editing functions, found when testing with clips whose source ranges did not start at zero:
Assisted-by: Claude Code / Claude Opus 5.5
Note from Claude:
Before and after diagrams of the fixes, made with the OTIO SVG adapter.
Each diagram has three tracks: the track before the edit, the result on main ("Current"), and the result with this PR ("Fixed").
Clips A and B use frames 10-19 of 30 frame media, so the source ranges don't start at zero. The bar under each clip shows which part of its media is used.
overwrite: frames 8-11 with C, across the cut between A and B
B should keep frames 12-19, but kept 18-19, and the track got shorter.
overwrite: frames 3-6 inside A, with a C that is longer than the range
C should start at its own frame 5, but was given A's start, frame 10.
insert: C at frame 3, splitting A
The second part of A should continue at frame 13, but started at 17, skipping frames 13-16.
roll: the end of A by +3 frames
B should get 3 frames shorter, but kept its duration, so the track got longer.
roll: the start of B by -10 frames, the whole length of A
A should be left with one frame, but was left with none.
ripple: the start of A by +3 frames
A should start at frame 13, but the clamp moved it to frame 0.
trim: the start of B by +3 frames
The hole should be filled with a gap, but A was extended into it.
trim: the end of A by +3 frames, into the gap
The gap should get 3 frames shorter, but kept its duration, so the track got longer.
trim: the end of A by -3 frames, away from the gap
The gap should get 3 frames longer, but got 3 frames shorter, so the track lost 6 frames.