Fix paste filter to track regression #1922

Merged
ddennedy opened 6:06pm on September 29, 2026 wanted to merge 203 Ξ” into mltframework/shotcut master from
fix-paste-track-filter
Diff Delta:
203
About 68 Diff Delta/hour
Classified as:  Bug Fix

ddennedy's Description of Work

See bug report https://forum.shotcut.org/t/copying-a-filter-from-a-clip-to-a-track-creates-an-empty-fake/51989

This pull request improves the handling of filter ordering and indexing in the filter management logic, particularly to ensure correct placement of user-visible and hidden filters (such as the track audio-level meter) and to fix related bugs in filter paste and model row mapping. The changes enhance both internal correctness and user interface consistency.

Filter Ordering and Placement Improvements:


  • Added a new firstPostUserFilterIndex function in mltcontroller.cpp to accurately locate the first hidden post-user filter, ensuring that track volume filters and pasted filters are positioned correctly relative to hidden filters like the audio-level meter. Updated the moveTrackVolumeFilterToEnd function to use this logic for more precise placement.

  • Updated the filter pasting logic in copyFilters to ensure that pasted filters are placed ahead of hidden post filters and that GPU filters are inserted at the correct destination index, preventing UI binding issues and maintaining correct filter order.

  • Removed redundant adjustment of filters in pasteFilters, as this is now handled more accurately within copyFilters and moveTrackVolumeFilterToEnd.

Model Row and Filter Index Mapping:


  • Replaced the userFilterCount function with a new userFilterMltIndex function in attachedfiltersmodel.cpp to correctly map model rows to MLT filter indices, skipping hidden filters and ensuring user actions target the correct filters. Updated mltFilterIndex to use this new logic.

2 total changed files
Loading changes...
Loading changes...
You’ve reached the end
Approve, request changes, or stare into the void (reviewer's choice) πŸ˜