Closed guilhermehto closed 5 years ago
@NathanLovato should be good now 🙂
There's a little bug with effect strips left, but besides it's working now. I'll merge and patch now. Thanks!
A quick note on using if statements to check and run code: a rule in python is that it's best to ask for forgiveness than permission. You can often use try/except to run code that should work most of the time and handle exceptional cases.
In the example below, there are only 2 cases taken in account. Quite a few possible edge cases that'll trigger errors:
if s == sequence and side == 'LEFT':
s.frame_start -= gap
continue
if sequence.frame_final_end < s.frame_final_start:
s.frame_start -= gap
You can use try to let Python handle these for you:
if s == sequence and side == 'LEFT' or sequence.frame_final_end < s.frame_final_start:
try:
s.frame_start -= gap
except AttributeError: # Pass for any strip that doesn't have the frame_start attribute
continue
I didn't use it enough in the past, but it's a super convenient feature.
The ripple works only on sequences that are in the same line as the selected ones. To use it, press
shift
along with the other keys.219 also asks for remove gaps, but I'm not sure how to go about it because of the shortcuts:
ctrl
is for leftalt
is for rightshift
adds rippleThis leaves us out of modifier keys to add.
Suggestions are welcome.
If remove gaps is not needed anymore, this PR closes #219