snap_sources and snap_targets take only non selected strips, so single strip and when it is selected (when snapping) it returns from transform_snap_sequencer_data_alloc. Freeing of allocated mem done afterwards too in function so just changing condition should be fine here.
Details
- Reviewers
Richard Antalik (ISS) - Maniphest Tasks
- T90967: VSE: Snap to current frame not working
- Commits
- rB4abbf6d82b19: Fix T90967: Snapping not working with single strip
Diff Detail
- Repository
- rB Blender
Event Timeline
Technically this is correct, but if BLI_listbase_count(seqbase) == 0 then SEQ_collection_len(snap_sources) and SEQ_collection_len(snap_targets) must be 0, so then it wouldn't make sense to include them in condition. So better condition would be to just not check if SEQ_collection_len(snap_targets) == 0 is true. If this would cause issues we can inspect snap_data->target_snap_point_count after array is initialized and cancel snapping if there are no targets.
So I will commit what I suggested.
Just a suggestion:
Patch title and description should match commit message, that makes life easier so you can commit directly without edits. When you put Fix T90967: Snap not working with single strip in title, ticket will be closed automatically when patch is committed.