Browse Source

Empty blocks with explicit minimum tick duration will not be deleted anymore byDelete All Empty Blocks command

master
Nils 2 years ago
parent
commit
e598f55f1d
  1. 4
      engine/main.py

4
engine/main.py

@ -1039,14 +1039,14 @@ class Data(template.engine.sequencer.Score):
#for trId, track in Track.allTracks.items():
for track in list(self.hiddenTracks.keys()) + self.tracks:
if len(track.blocks) <= 1:
if len(track.blocks) <= 1: #Don't delete the last block in a track
continue #next track
#Get all blocks and then remove those with no content.
trId = id(track)
listOfBlockIds = track.asListOfBlockIds()
for block in track.blocks:
if not block.data:
if not block.data and not block.minimumInTicks: #empty "spacer" blocks with minimum duration will be kept.
listOfBlockIds.remove(id(block))
#Maybe the track was empty. In this case we add one of the blocks again. Otherwise follow up functions will not act.
if not listOfBlockIds:

Loading…
Cancel
Save