GDQuest / blender-power-sequencer

Add-on for video editing in Blender 3D: edit videos faster! Included in Blender 2.81+
https://gdquest.com/blender/power-sequencer/
GNU General Public License v3.0
708 stars 58 forks source link

Bugs in swap_strips.py #427

Closed TheChocolateOre closed 4 years ago

TheChocolateOre commented 4 years ago

I'm submitting a...

Bug report

What is the current behavior?

  1. If I try to swap a number of strips that is not 2, I get an unexpected behaviour.
  2. If 1 of the strips of the swap is an effect, I get an AttributeError exception.

What is the expected behavior?

  1. Reading the docs in the swap_strips.py file, it is stated: Swaps the 2 strips between them. Trying to swap a different number of strips must cancel the operator. Solution: Change line 57 with return len(bpy.context.selected_sequences) == 2
  2. Do not throw an exception and perform the swap (if possible). Solution: Functions are_linked and swap_with_effect are 1 tab intended at the right, so they are part of find_closest_strip_vertical function, probably a typo. Undo the tab, to become part of POWER_SEQUENCER_OT_swap_strips class.

Tell us the steps to reproduce the bug, and if possible share a minimal demo of the problem.

  1. Swap a number of strips that is not 2.
  2. Try to swap a strip with 1 of its effects or 2 of its effects between them.
NathanLovato commented 4 years ago

Thanks for the report. Note that we shouldn't use len or similar functions in poll for performances - it gets evaluated on every UI refresh, and it builds the list from scratch every time to calculate its length. But I've added the check in execute.