def getClipID(self, clipLocation: DeckLocation, deckID: int = None): (layerNumber, clipNumber) = clipLocation if deckID is None: deckState = self.selectedDeckState else: deckState = self.decks[deckID]['state'] return intIfSet(deckState[layerNumber, clipNumber])
def GetSaveState(self): return { layerID: { 'Layername': layer.par.Layername.eval(), 'Nextlayerid': intIfSet(layer.par.Nextlayerid.eval()) } for layerID, layer in self.layers.items() }
def SetClip(self, layerNumber, clipID: int): layer = self.getLayerByOrder(layerNumber) previousClipID = intIfSet(layer.par.Clipid.val) layer.par.Clipid = clipID if clipID is not None: self.clipCtrl.ActivateClip(clipID) if previousClipID is not None and previousClipID != clipID: self.clipCtrl.DeactivateClip(previousClipID)
def getSourceID(effectOp): return intIfSet(effectOp.par.Sourceeffectid.eval()) if effectOp else None
def headEffectID(self): return intIfSet(self.ownerComponent.par.Headeffectid.eval())
def test_intIfSet(): assert intIfSet('4') == 4 assert intIfSet('') is None assert intIfSet(0) == 0