Commit 8b555f6
authored
Fix Motion Tracker keyframes not applying after save/reload (#1854)
* Fix Motion Tracker keyframes not applying after save/reload
MotionTrackerModel::trackingData parsed each keyframe's time key with
QString::toInt, which only accepts integer frame numbers ("5"). When a
project is saved, Shotcut serializes animated properties (including the
opencv.tracker `results`) in clock time format (00:00:00.167). After a
save+reload, toInt then failed on every entry, trackingData returned an
empty list, and "Load Keyframes from Motion Tracker" silently applied
zero keyframes (the masked rect stayed static).
Accept both frame-number and clock/timecode keys. The parsed frame value
is not used downstream (only the rectangles are consumed by applyTracking
and reset), so fall back to the running index when toInt fails.
* Use time_to_frames to parse tracker keyframe times
Responding to review feedback: rather than falling back to the running
index when QString::toInt fails on a clock-time key, parse the keyframe
time with Mlt::Consumer::time_to_frames. It converts both the clock form
("00:00:00.167") and the frame-number form ("5") to the correct frame
using the project frame rate, so a project reloaded with clock-time
results no longer yields an empty list and the keyframes apply.1 parent 110f657 commit 8b555f6
1 file changed
Lines changed: 9 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
264 | 264 | | |
265 | 265 | | |
266 | 266 | | |
267 | | - | |
268 | 267 | | |
| 268 | + | |
269 | 269 | | |
270 | 270 | | |
271 | 271 | | |
272 | 272 | | |
273 | | - | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
274 | 280 | | |
275 | 281 | | |
276 | | - | |
277 | | - | |
278 | | - | |
| 282 | + | |
279 | 283 | | |
280 | 284 | | |
281 | 285 | | |
| |||
0 commit comments