#Blocks are never truly deleted but a stored in the GraphBlock.allBlocks dict. This keeps the reference to this deleted block alive and it can be added through rearrange, which gets its blocks from this dict.
#Blocks are never truly deleted but stored in the GraphBlock.allBlocks dict. This keeps the reference to this deleted block alive and it can be added through rearrange, which gets its blocks from this dict.
"""at least one block. If you want to delete the track
useapi.deleteGraphTrackCC"""
iflen(self.blocks)>1:
graphBlock.parentGraphTrack=None
#graphBlock.parentGraphTrack = None #We still need this for undo!
self.blocks.remove(graphBlock)
returngraphBlock
@ -685,13 +685,13 @@ class GraphTrackCC(object):
ifblock.getMaxContentPosition()==block.duration:
block.remove(block.duration)
defotherTracksWithOurLinkedContent(self)->set:
"""returns all tracks that need to be updated we change"""
"""returns all tracks that need to be updated"""
#TODO: A bit wasteful. Optimisation? Did really a content linked block change?
result=set()
forblockinself.blocks:
forlinkedBlockinblock.linkedContentBlocks:
forlinkedBlockinblock.linkedContentBlocks:
result.add(linkedBlock.parentGraphTrack)
assertresult#at least this very track
assertresult#at least this very track
assertlen(result)<=len(self.parentTrack.parentData.tracks)#For now we assume that blocks cannot be linked across CCs. This can be removed after we tested it for a while and the time comes for cross-CC links