def getSingingNote(toon, note, volume=1): """ Returns a track of the toon singing the requested note. note is a string in small letters. Eg - g1, a, b, c, d, e, f, g2 """ sfx = None filePath = "phase_3.5/audio/dial/" filePrefix = "tt_s_dlg_sng_" fileSuffix = ".mp3" speciesName = ToonDNA.getSpeciesName(toon.style.head) sfx = base.loadSfx(filePath + filePrefix + speciesName + "_" + note + fileSuffix) # Need to use a Func interval since DoEmote expects a 0 duration track def playSfx(volume=1): base.playSfx(sfx, volume=volume, node=toon) def playAnim(): toon.loop('neutral') def stopAnim(): toon.setPlayRate(1, 'neutral') track = Sequence(Func(toon.showSurpriseMuzzle), Parallel(Func(playAnim), Func(playSfx, volume))) exitTrack = Sequence(Func(toon.hideSurpriseMuzzle), Func(stopAnim)) return track, 0.1, exitTrack
def doMelt(toon, volume=1): speciesName = ToonDNA.getSpeciesName(toon.style.head) sfx = base.loadSfx('phase_3.5/audio/dial/AV_' + speciesName + '_exclaim.ogg') sfx2 = base.loadSfx('phase_5/audio/sfx/TL_quicksand.ogg') track = Sequence(Func(toon.blinkEyes), Func(toon.sadEyes), Func(toon.play, 'melt'), Wait(1), Func(base.playSfx, sfx, volume=volume, node=toon), Func(base.playSfx, sfx2, volume=volume, node=toon)) duration = toon.getDuration('melt') exitTrack = Sequence(Func(toon.normalEyes), Func(toon.blinkEyes)) return (track, duration, exitTrack)
def doMelt(toon, volume=1): speciesName = ToonDNA.getSpeciesName(toon.style.head) sfx = base.loadSfx('phase_3.5/audio/dial/AV_' + speciesName + '_exclaim.ogg') sfx2 = base.loadSfx('phase_5/audio/sfx/TL_quicksand.ogg') track = Sequence( Func(toon.blinkEyes), Func(toon.sadEyes), Func(toon.play, 'melt'), Wait(1), Func(base.playSfx, sfx, volume=volume, node=toon), Func(base.playSfx, sfx2, volume=volume, node=toon) ) duration = toon.getDuration('melt') exitTrack = Sequence(Func(toon.normalEyes), Func(toon.blinkEyes)) return (track, duration, exitTrack)
def getSingingNote(toon, note, volume = 1): sfx = None filePath = 'phase_3.5/audio/dial/' filePrefix = 'tt_s_dlg_sng_' fileSuffix = '.ogg' speciesName = ToonDNA.getSpeciesName(toon.style.head) sfx = base.loadSfx(filePath + filePrefix + speciesName + '_' + note + fileSuffix) def playSfx(volume = 1): base.playSfx(sfx, volume=volume, node=toon) def playAnim(): toon.loop('neutral') def stopAnim(): toon.setPlayRate(1, 'neutral') track = Sequence(Func(toon.showSurpriseMuzzle), Parallel(Func(playAnim), Func(playSfx, volume))) exitTrack = Sequence(Func(toon.hideSurpriseMuzzle), Func(stopAnim)) return (track, 0.1, exitTrack)
def getSingingNote(toon, note, volume = 1): sfx = None filePath = 'phase_3.5/audio/dial/' filePrefix = 'tt_s_dlg_sng_' fileSuffix = '.ogg' speciesName = ToonDNA.getSpeciesName(toon.style.head) sfx = base.loadSfx(filePath + filePrefix + speciesName + '_' + note + fileSuffix) def playSfx(volume = 1): base.playSfx(sfx, volume=volume, node=toon) def playAnim(): toon.loop('neutral') def stopAnim(): toon.setPlayRate(1, 'neutral') track = Sequence(Func(toon.showSurpriseMuzzle), Parallel(Func(playAnim), Func(playSfx, volume))) exitTrack = Sequence(Func(toon.hideSurpriseMuzzle), Func(stopAnim)) return (track, 0.1, exitTrack)